Keras在读取模型load_model(xxx.h5)时,遇到报错:
AttributeError: ‘str’ object has no attribute ‘decode’
原因是h5py版本是3.0.0,然而版本过于高级(呃,或者说tf2.3略低端),无法适配tf2.3,因而把h5py降到2.1.0就可以了。
命令行输入:
pip install h5py==2.10.0 --force-reinstall
我这边用的conda install,所以记得开vpn全局。如果用pip install也是可以的。
Referecne:
https://stackoverflow.com/questions/53740577/does-any-one-got-attributeerror-str-object-has-no-attribute-decode-whi
https://github.com/tensorflow/tensorflow/issues/44467