个人经历记录贴,若有侵请联系我谢谢。
目录
Python/Tensorflow/Keras版本对应
按理说Tensorflow 2.x已经集成了Keras 如果有报错可能需要检查一下版本对应。
关于h5py,Tensorflow2.1 不支持 h5py >= 3.0.0。
可参考我所用的版本对应:
Python 3.7(conda) + Tensorflow 2.1.0 + Keras 2.3.0 + h5py 2.10.0

AttributeError: module ‘h5py’ has no attribute ‘File’
重装h5py库。使用conda环境的话在python命令行里:
pip uninstall h5py
conda install h5py
非conda环境:
pip uninstall h5py
pip install h5py
AttributeError: ‘str’ object has no attribute ‘decode’
model_config = json.loads(model_config.decode(‘utf-8’))AttributeError: ‘str’
解决方法同上。h5py版本对应问题。
===不定期更新
本文介绍了在Python环境下遇到的h5py模块错误,如'File'和'decode'属性缺失,以及如何通过重装和版本对应解决。特别提到Tensorflow 2.1与Keras 2.3的兼容性和h5py版本限制。

1万+

被折叠的 条评论
为什么被折叠?



