Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行demo.py收到了一个报错 #43

Open
exition opened this issue Nov 21, 2020 · 1 comment
Open

运行demo.py收到了一个报错 #43

exition opened this issue Nov 21, 2020 · 1 comment

Comments

@exition
Copy link

exition commented Nov 21, 2020

Load Error:'utf-8' codec can't decode byte 0xda in position 5: invalid continuation byte
Try Load Again...
Traceback (most recent call last):
File ".\core\demo.py", line 17, in my_torch_load
ckpt = torch.load(fname)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line 585, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line 765, in _legacy_load
result = unpickler.load()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 5: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File ".\core\demo.py", line 66, in
ckpt = my_torch_load(args.resume)
File ".\core\demo.py", line 30, in my_torch_load
ckpt = torch.load(args.resume, pickle_module=c)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line 585, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\serialization.py", line 755, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
TypeError: c_load() got an unexpected keyword argument 'encoding'

我的 python版本是3.7.4

@hmate9
Copy link

hmate9 commented Jan 6, 2021

In demo.py change ckpt = torch.load(args.resume, pickle_module=c) to ckpt = torch.load(args.resume, encoding='latin1')

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

No branches or pull requests

2 participants