问题描述
报错:AttributeError: 'bytes' object has no attribute 'encode'
File "S:\physon\envs\tensorflow\lib\site-packages\keras\engine\saving.py", line 377, in <listcomp>
n.encode('utf-8').decode('utf-8') for n in
AttributeError: 'bytes' object has no attribute 'encode'
使用conda list查看依赖
原因分析:
keras与h5py版本不兼容:
由于之前跑另一个模型将号h5py版本从3.10换到了2.10,现在换了个模型就报错,只能再换回去
解决方案:
更换原来的h5py版本:
pip install h5py==3.1.0