pnlbwh / CNN-Diffusion-MRIBrain-Segmentation

CNN based brain masking
Other
14 stars 10 forks source link

Error while loading saved model #24

Open tashrifbillah opened 3 years ago

tashrifbillah commented 3 years ago
Traceback (most recent call last):
  File "/home/pnlbwh/CNN-Diffusion-MRIBrain-Segmentation/pipeline/dwi_masking.py", line 716, in <module>
    dwi_mask_sagittal = predict_mask(cases_file_s, trained_model_folder, view='sagittal')
  File "/home/pnlbwh/CNN-Diffusion-MRIBrain-Segmentation/pipeline/dwi_masking.py", line 134, in predict_mask
    loaded_model.load_weights(optimal_model)
  File "/home/pnlbwh/miniconda3/envs/pnlpipe3/lib/python3.6/site-packages/keras/engine/network.py", line 1166, in load_weights
    f, self.layers, reshape=reshape)
  File "/home/pnlbwh/miniconda3/envs/pnlpipe3/lib/python3.6/site-packages/keras/engine/saving.py", line 1004, in load_weights_from_hdf5_group
    original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
tashrifbillah commented 3 years ago

Following https://github.com/keras-team/keras/issues/14265

tashrifbillah commented 3 years ago

If the issue occurs with an independent install of this package, use - h5py<3 in the conda recipes.