File "/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 234, in load_weights
return super(Model, self).load_weights(filepath, by_name, skip_mismatch)
File "/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1222, in load_weights
hdf5_format.load_weights_from_hdf5_group(f, self.layers)
File "/opt/conda/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 651, in load_weights_from_hdf5_group
original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
在安装tensorflow时,默认安装h5py为3.1.0,而报错是因为你安装的TF不支持过高版本的h5py。
1.卸载h5py3.1.0版本,安装h5py2.10.0版本。
2.重启编译器
pip install h5py==2.10.0