AttributeError: ‘bytes‘ object has no attribute ‘encode‘

Problem Description

报错: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'

Use conda list to view dependencies
insert image description here

Cause Analysis:

keras is not compatible with h5py version:

Because I ran another model before and changed the h5py version from 3.10 to 2.10, now I change the model and report an error, so I can only change it back


solution:

Replace the original h5py version:

pip install h5py==3.1.0

Guess you like

Origin blog.csdn.net/weixin_45913922/article/details/124013011