Skip to content Skip to sidebar Skip to footer

Attempt To Open H5py File, Returns Errorno = 17, Error Message = 'file Exists'

import numpy as np import h5py with h5py.File('testfile.hdf5', 'w-') as f: arr = np.ones((5,2)) f['my dataset'] = arr dset = f['my dataset'] This code runs

Solution 1:

I encountered the exact same error message when I use HDF5Matrix class in keras(v2.2.2). However, I failed to find a mature solution to completely avoid this error when I have multiple training processes which all need to access the same HDF5 data on the disk. Only one process could successfully access this HDF5 data, while all others would report the same error, even though I modified the reading mode from the default r+ to r. I gave up and used the workable solution that keeps multiple copies of HDF5 data and one copy for each training process.

Solution 2:

As per http://docs.h5py.org/en/latest/high/file.html, the w- mode is designed to cause the open operation to fail if the file already exists.

Post a Comment for "Attempt To Open H5py File, Returns Errorno = 17, Error Message = 'file Exists'"