matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.68k stars 11.7k forks source link

AttributeError: 'str' object has no attribute 'decode' #2594

Open Chethan187 opened 3 years ago

Chethan187 commented 3 years ago

While running demo.ipynb i get the below error:

Tensorflow version = 1.15.0

AttributeError Traceback (most recent call last)

in 3 4 # Load weights trained on MS-COCO ----> 5 model.load_weights(COCO_MODEL_PATH, by_name=True) ~\Documents\Mask_RCNN-master\mrcnn\model.py in load_weights(self, filepath, by_name, exclude) 2128 2129 if by_name: -> 2130 saving.load_weights_from_hdf5_group_by_name(f, layers) 2131 else: 2132 saving.load_weights_from_hdf5_group(f, layers) c:\users\chethan\anaconda3\envs\rcnn\lib\site-packages\keras\engine\topology.py in load_weights_from_hdf5_group_by_name(f, layers, skip_mismatch, reshape) 3416 """ 3417 if 'keras_version' in f.attrs: -> 3418 original_keras_version = f.attrs['keras_version'].decode('utf8') 3419 else: 3420 original_keras_version = '1' AttributeError: 'str' object has no attribute 'decode' How can I fix this issue ?
TimNagle-McNaughton commented 3 years ago

Are you using tensorflow-gpu? What keras version are you using?

Chethan187 commented 3 years ago

I'm not using tensorflow-gpu version.

Below are the current versions: Tensorflow: 1.14.0 Keras: 2.1.6

bhsnada commented 3 years ago

Try to install h5py To resolve this problem !pip install h5py==2.10.0

Chethan187 commented 3 years ago

@bhsnada Thank you! This worked for me.

hamzanaeem1999 commented 3 years ago

Thanks , This works for me too!

ShakhzodbekYuldoshov commented 2 years ago

Thank you very much worked for me also!

bisalgt commented 1 year ago

Thank you so much. Worked for me too.

rommel22 commented 1 year ago

@bhsnada Thank you! This worked for me.

Try to install h5py To resolve this problem !pip install h5py==2.10.0

i've tried download it but it didnt work it gives this error message

"ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects"

How can i fix this issue ?

matbee-eth commented 12 months ago

@bhsnada Thank you! This worked for me.

Try to install h5py To resolve this problem !pip install h5py==2.10.0

i've tried download it but it didnt work it gives this error message

"ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects"

How can i fix this issue ?

I have a similar issue on osx

NganAmy commented 6 months ago

@bhsnada Thank you! This worked for me.

Try to install h5py To resolve this problem !pip install h5py==2.10.0

i've tried download it but it didnt work it gives this error message

"ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects"

How can i fix this issue ?

That's my issus now, python 3.10

fsnstupidbear commented 2 months ago

Try to install h5py To resolve this problem !pip install h5py==2.10.0

thanks!this works fine!