question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

As discussed in #4 , h5py 2.7.0 is required. After downgrading pip install h5py=2.7.0, I still have

$ mpirun -n 4 python test_h5py.py
hdf5_version=1.10.1
hdf5_version=1.10.1
rank 0 read and write
Traceback (most recent call last):
  File "test_h5py.py", line 10, in <module>
    f  = h5py.File('surf_file.h5', 'r+')
  File "/home/weiw/anaconda2/lib/python2.7/site-packages/h5py/_hl/files.py", line 271, in __init__
    fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
  File "/home/weiw/anaconda2/lib/python2.7/site-packages/h5py/_hl/files.py", line 103, in make_fid
    fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
  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/h5f.pyx", line 78, in h5py.h5f.open
IOError: Unable to open file (Unable to lock file, errno = 11, error message = 'resource temporarily unavailable')
hdf5_version=1.10.1
rank 0 read and write

Also seems the version plots are different here:

$ python
>>> import h5py
>>> print (h5py.version.hdf5_version)
1.10.1
>>> print h5py.__version__
2.7.0
>>>

OS: "Ubuntu 16.04.5 LTS" Python:

Python 2.7.15 |Anaconda, Inc.| (default, Oct 23 2018, 18:31:10)
[GCC 7.3.0] on linux2

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
Jamesswizcommented, Jun 14, 2019

Downgrading h5py worked for me

pip3 install --user ‘h5py==2.7.0’ --force-reinstall --no-cache-dir

2reactions
deepmo24commented, Jun 6, 2019

I have the same problem as you. I’d like to provide my solution here.

Since the error is caused by the mode conflicts(r+ and r), we can solve this by changing the code, not depending on the version of h5py or hdf5. My idea is creating another h5 file( named surf_file_new) to store the losses and accuracies, so we only need to open the surf_file with ‘r’ mode and surf_file_new with ‘w’ mode.

For less code changing, I copy the content of surf_file to surf_file_new and after function cruch(), I let surf_file = surf_file_new, so that we don’t need to change the subsequent code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

h5py - PyPI
Supports HDF5 versions 1.8.4 and higher. On Windows, HDF5 is included with the installer.
Read more >
Installation — h5py 3.7.0 documentation
To install h5py from source, you need: A supported Python version with development headers. HDF5 1.8.4 or newer with development headers. A C...
Read more >
HDF5 for Python
The h5py package is a Pythonic interface to the HDF5 binary data format. It lets you store huge amounts of numerical data, and...
Read more >
HDF5 for Python — h5py 3.7.0 documentation
The h5py package is a Pythonic interface to the HDF5 binary data format. HDF5 lets you store huge amounts of numerical data, and...
Read more >
What's new in h5py 2.0 — h5py 3.7.0 documentation
HDF5 for Python (h5py) 2.0 represents the first major refactoring of the h5py codebase since the project's launch in 2008. Many of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found