Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

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

Open Chethan187 opened this issue 3 years ago • 10 comments

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 ?

Chethan187 avatar Jun 11 '21 14:06 Chethan187

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

TimNagle-McNaughton avatar Jun 11 '21 17:06 TimNagle-McNaughton

I'm not using tensorflow-gpu version.

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

Chethan187 avatar Jun 12 '21 13:06 Chethan187

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

bhsnada avatar Jun 13 '21 20:06 bhsnada

@bhsnada Thank you! This worked for me.

Chethan187 avatar Jun 14 '21 05:06 Chethan187

Thanks , This works for me too!

hamzanaeem1999 avatar Jun 14 '21 08:06 hamzanaeem1999

Thank you very much worked for me also!

ShakhzodbekYuldoshov avatar Dec 11 '21 17:12 ShakhzodbekYuldoshov

Thank you so much. Worked for me too.

bisalgt avatar Jan 07 '23 20:01 bisalgt

@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 ?

rommel22 avatar Sep 27 '23 05:09 rommel22

@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

matbee-eth avatar Nov 14 '23 02:11 matbee-eth

@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

NganAmy avatar May 02 '24 14:05 NganAmy