‘str‘ object has no attribute ‘decode‘
‘str’ object has no attribute ‘decode’解决办法
使用keras进行load_weights时,报错如下:
File"/home/liqiang/anaconda3/envs/tensorflow1.8/lib/python3.6/site-packages/keras/engine/saving.py", line 1004, in load_weights_from_hdf5_group
original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
解决办法如下:
pip install h5py==2.10 -i https://pypi.tuna.tsinghua.edu.cn/simple/
如果报错就到后面加上 —user
还没有评论,来说两句吧...