问题AttributeError: ‘str‘ object has no attribute ‘decode‘

  File "D:\anaconda3\envs\python37\lib\site-packages\keras\engine\network.py", line 1230, in load_weights
    f, self.layers, reshape=reshape)
  File "D:\anaconda3\envs\python37\lib\site-packages\keras\engine\saving.py", line 1183, in load_weights_from_hdf5_group
    original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'

在编译过程需要调用h5py,但由于h5py与keras版本不匹配所引起的错误

解决方案:手动降低h5py版本

pip uninstall h5py
pip install h5py==2.10

这样问题就解决啦!

你可能感兴趣的:(环境问题,python,tensorflow,开发语言)