keras保存的h5模型加载时出现“AttributeError: 'str' object has no attribute 'decode'”

问题说明

  keras保存的h5模型,在使用load_model函数时,出现“AttributeError: ‘str’ object has no attribute 'decode’”问题。

解决办法

  我的tensorflow是2.0.0版本,keras是2.3.1版本,h5py模块的版本不匹配,改用2.10版本,问题解决。

pip install h5py==2.10 -i https://pypi.doubanio.com/simple
posted @ 2021-08-05 10:07  小宗要加油  阅读(1081)  评论(0)    收藏  举报