AttributeError: 'str' object has no attribute 'decode'
(1) 背景:keras load_model出现如题错误 解决办法,定位到错误处 去掉 decode 思路: 根据问题提示,属性错误:“str”对象没有属性“decode” python3.5和Python2.7在套接字返回值解码上的区别 python在bytes和str两种类型转换,所需要的函数依次是encode(),decode() (2)背景:keras load_model出现以下错误 加载keras模型’tf’ is not defined on load_model() - using lambda NameError: name 'keras’ is not defined报错 解决: import keras load_model(‘xxx.h5’,custom_objects={‘keras’: keras}) 来源: CSDN 作者: Rebecca(swust) 链接: https://blog.csdn.net/qq_35705332/article/details/103896511