UnicodeDecodeError when loading the pre-trained model
See original GitHub issueThank you for your great work!
When I tried to load the model you provided here, I encountered the following error:
Traceback (most recent call last):
File "tools/run_net.py", line 152, in <module>
main()
File "tools/run_net.py", line 128, in main
train(cfg=cfg)
File "/home/ubuntu/projects/SlowFast/tools/train_net.py", line 217, in train
convert_from_caffe2=cfg.TRAIN.CHECKPOINT_TYPE == "caffe2",
File "/home/ubuntu/projects/SlowFast/slowfast/utils/checkpoint.py", line 212, in load_checkpoint
checkpoint = torch.load(path_to_checkpoint, map_location="cpu")
File "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.7/site-packages/torch/serialization.py", line 426, in load
return _load(f, map_location, pickle_module, **pickle_load_args)
File "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.7/site-packages/torch/serialization.py", line 603, in _load
magic_number = pickle_module.load(f, **pickle_load_args)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 1: invalid continuation byte
This problem occurred probably because I tried to decode in a different way from way of encoding. I would appreciate it if you could show me how this problem has happened, and how to solve it.
Thank you for your consideration!
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
getting unicode decode error while trying to load pre-trained ...
This error hits whenever the model is pretrained on torch version < 0.4 but using torch version > 0.4 for testing / resuming....
Read more >Question about an error when loading pretrained models
When I loaded the pretrained model using the following code: ckp ... map_location='cpu') I meet an error which is “UnicodeDecodeError: ...
Read more >UnicodeDecodeError when "Splitting data into training and ...
When first attempting to train model, Training output shows: Creating job... OK (ID: 1016858) Job started Splitting data into training and ...
Read more >Fasttext error while loading wiki pre-trained data
You could use the load_model method instead of load_fasstext_format method. Also, you could FastText Library directly without really having to install ...
Read more >invalid start byte python - You.com | The search engine you control.
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 3131: invalid start byte ... When I load the pretrained model from the local...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I use default.py and never changed. _C.TRAIN.CHECKPOINT_TYPE = “pytorch”
Once I switch pytorch to caffe2, I succeeded in loading the pre-trained model. Thank you so much!!
Thank you for replying.
I use Python 3.7.3, which may cause this problem. I am going to use 3.6 and let you know what happens.