Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

运行run_eval.py文件之后,出现了这个错误,UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 50: invalid continuation byte,请问怎么解决? #23

Open
zhulewen1998 opened this issue Sep 7, 2022 · 1 comment

Comments

@zhulewen1998
Copy link

运行run_eval.py文件之后,出现了这个错误,UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 50: invalid continuation byte,请问怎么解决?

@AKprince
Copy link

AKprince commented Jan 9, 2023

运行run_eval.py文件之后,出现了这个错误,UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 50: invalid continuation byte,请问怎么解决?

这个可能是GFile读取的问题,我的解决方法是将
with tf.io.gfile.GFile(ckpt_path, 'rb') as f:
data = f.read()
这两行删掉,直接用np.load()加载checkpoint.npz文件
即,values = np.load('checkpoint.npz')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants