Closed johnnytam100 closed 3 years ago
I think it's not related to h5py. Instead, I think you failed to download the correct model files. Could you please check the model file in github and your local? I suspected what you downloaded is a file with a smaller size(which suggests it's broken).
Wang, I have used exactly the same model files that I successfully ran locally, but when I run on a cluster that failed. Anyway, if you come to mind why this might have happened, please tell me. :)
That's interesting! I think it should be exactly same for running on local or cluster. I suspected your cluster environment is a little different. Could you please check the version of h5py, keras and tensorflow to make sure cluster have the same env as you had locally.
import h5py
h5py.__version__
Hi Wang, I see! I have tried but both versions match. Anyway, it's probably other problems in the environment. So thanks for helping out!
My pleasure, feel free to open issues if encounter other questions.
When I tried to run a python script that uses h5py, it returns an OSError:
Traceback (most recent call last): File "main.py", line 67, in
record,input_path=run_pred_single(file_path,random_id,gpu_id)
File "main.py", line 23, in run_pred_single
result=Exec_Prediction(indicate,input_path)
File "/bwfefs/home/cltam/20210511_NbX_DOVE_test_cluster/cluspro_1bzq/Prediction/Exec_Prediction.py", line 22, in Exec_Prediction
model.load_weights(model_path)
File "/home/cltam/.pyenv/versions/anaconda3-5.3.1/envs/tf012/lib/python3.5/site-packages/keras/models.py", line 724, in load_weights
with h5py.File(filepath, mode='r') as f:
File "/home/cltam/.pyenv/versions/anaconda3-5.3.1/envs/tf012/lib/python3.5/site-packages/h5py/_hl/files.py", line 408, in init
swmr=swmr)
File "/home/cltam/.pyenv/versions/anaconda3-5.3.1/envs/tf012/lib/python3.5/site-packages/h5py/_hl/files.py", line 173, in make_fid
fid = h5f.open(name, flags, 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 88, in h5py.h5f.open
OSError: Unable to open file (unable to lock file, errno = 95, error message = 'Operation not supported')
Wang, do you know the cause, possibly related to h5py?