f.attrs[‘keras_version‘].decode(‘utf8‘) AttributeError: ‘str‘ object has no attribute ‘decode‘

 File "E:\ProgramData\Anaconda3\envs\gan\lib\site-packages\keras\engine\topology.py", line 3328, 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/

问题解决!!

你可能感兴趣的:(python)