keras的一些报错记录


报AttributeError: 'str' object has no attribute 'decode'

查看报错代码在哪,

 File "F:\Anaconda3\envs\tf1\lib\site-packages\keras\engine\saving.py", line 1008, in load_weights_from_hdf5_group
    original_backend = f.attrs['backend'].decode('utf8')

我这里是anaconda里面报的错

然后我们直接修改代码

original_keras_version = f.attrs['keras_version'].decode('utf8')
修改
original_keras_version = f.attrs['keras_version'].encode('utf-8').decode('utf8')

original_backend = f.attrs['backend'].decode('utf8')
修改
original_backend = f.attrs['backend'].encode('utf-8').decode('utf8')

报错AttributeError: module 'yaml' has no attribute 'save_load'
config = yaml(yaml_string)
修改
config = yaml.full_load(yaml_string)
 

你可能感兴趣的:(pytorch,opencv,python,python,anaconda)