str‘ object has no attribute ‘decode‘解决办法
程序员文章站
2022-07-13 10:51:48
...
File "\tensorflow_core\python\keras\saving\hdf5_format.py", l
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'
是hdf5包的问题
解决办法
pip install hdf5
pip install h5py -i https://pypi.tuna.tsinghua.edu.cn/simple/
推荐阅读
-
AttributeError: 'module' object has no attribute 'main'
-
解决Keras报错AttributeError: 'NoneType' object has no attribute 'inbound_nodes'
-
解决'DataFrame' object has no attribute 'sort'
-
‘MyObject‘ object has no attribute ‘***‘
-
AttributeError: ‘NoneType‘ object has no attribute ‘origin‘解决办法
-
AttributeError: ‘set‘ object has no attribute ‘append‘解决办法
-
解决:'Tensor' object has no attribute 'numpy'
-
str‘ object has no attribute ‘decode‘解决办法
-
'module' object has no attribute
-
AttributeError: 'GridSearchCV' object has no attribute 'grid_scores_'