original_keras_version = f.attrs[‘keras_version‘].decode(‘utf8‘)

 

File "/home/liqiang/anaconda3/envs/tensorflow1.8/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'

 

 

original_keras_version = f.attrs[‘keras_version‘].decode(‘utf8‘)_第1张图片

解决办法:

卸载原来的h5py模块,安装2.10版本

pip install h5py==2.10 -i https://pypi.tuna.tsinghua.edu.cn/simple/

 

解决问题参考的文章:

https://blog.csdn.net/xiqi4145/article/details/109547242

你可能感兴趣的:(解决问题)