tomgoldstein / loss-landscape

Code for visualizing the loss landscape of neural nets
MIT License
2.72k stars 388 forks source link

H5py file lock fix for newer h5py versions. #28

Closed KaleabTessera closed 3 years ago

KaleabTessera commented 4 years ago

So newer versions of h5py throw the following error when f = h5py.File(surf_file, 'r+' if rank == 0 else 'r') is called:

OSError: Unable to open file (unable to lock file, errno = 11, error message = 'Resource temporarily unavailable')

This fix prevents this error from happening and the project can run on newer versions of h5py. This will also finally fix issue https://github.com/tomgoldstein/loss-landscape/issues/4 .

ljk628 commented 4 years ago

Hi Kale-ab,

Thanks for the pull request and this seems to be a nice fix! Will test it on the latest version of hdf5. May I also know your test environment and the version of hdf5 and h5py?

KaleabTessera commented 4 years ago

Sure:

hdf5: 1.10.5
h5py: 2.10.0