问题描述
在跑代码的时候出现报错提示
Traceback (most recent call last):
File "multi_detect_Nerual.py", line 4, in <module>
import BiLSTM.bilstm_speech_seg_predict as nerual_seg
File "/home/xxx/xxx/xxx/BiLSTM/bilstm_speech_seg_predict.py", line 23, in <module>
model.load_weights(h5_model_file)
File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/site-packages/keras/engine/network.py", line 1166, in load_weights
f, self.layers, reshape=reshape)
File "/home/xxx/anaconda3/envs/xxx/lib/python3.7/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'
问题分析
该报错意思是:属性错误:'str'对象没有'decode'属性
解决方法