keras保存加载模型报错“AttributeError: ‘str‘ object has no attribute ‘decode‘”

原本配置

keras==2.1.5

tensorflow-gpu==1.13.2

numpy==1.17.4

加载模型报错:AttributeError: ‘str‘ object has no attribute ‘decode‘”

错误改法: 按错误改源代码:把decode改为encode。这样的改法虽然可以训练了,但是没有用!!!

正确改法:把h5py降到2.10.0版本就行了!!!!

原因分析:安装keras自动给下载高版本h5py导致报错!!