I think I am the only one who meet with this issue, because I never consult a solution on the Internet.
Here is my environment:
model.save('pointer_network_keras_1.h5')
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5o.pyx", line 202, in h5py.h5o.link
OSError: Unable to create link (name already exists)
It's wired because my other projects work fine.
You probably need to debug that with Keras first. That's a legitimate HDF5 error that normally means something tried to create a second object with the same name. It's more likely to be a bug in whatever code is using h5py, not h5py itself.
Leaving a comment here because I had a very similar h5py issue. I was using scanpy but receiving the same error messages, and couldn't find my solution anywhere online. Turns out, the issue was that in my anndata.var dataframe I had a column which was identical to the index (it was the column I used to define the index). I would guess that this was causing problems because you can't store two columns with the same name?
Anyway, the simple solution for me was to delete the column which was identical to the index. Took me a long time to get to the bottom of this and hopefully this comment may save someone time in the future.
Generally, names in an HDF5 group need to be different (like keys in a dict, or filenames in a folder). But it's up to the higher-level code (e.g. scanpy) how it represents a dataframe in HDF5.
@haskankaya absolute hero! 馃挴
You helped me, I also had problems with scanpy.
Turns out that the issue arises when name of index is same as a column name, so renaming the index or column would be adequate for a workaround. I posted an issue on scanpy's github here:
https://github.com/theislab/anndata/issues/452
Thanks to h5py for lending space on your github issues to scanpy problems ;)
Most helpful comment
Leaving a comment here because I had a very similar
h5pyissue. I was usingscanpybut receiving the same error messages, and couldn't find my solution anywhere online. Turns out, the issue was that in myanndata.vardataframe I had a column which was identical to the index (it was the column I used to define the index). I would guess that this was causing problems because you can't store two columns with the same name?Anyway, the simple solution for me was to delete the column which was identical to the index. Took me a long time to get to the bottom of this and hopefully this comment may save someone time in the future.