question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeDecodeError: 'ascii' codec can't decode byte 0x9b in position 1: ordinal not in range(128)

See original GitHub issue

Hello @KaiyangZhou , thank you for make this project. I try to running test on prid 2011 dataset using ResNet50m pretrained model you give, but got error

UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0x9b in position 1: ordinal not in range(128)

I think this error appear because pretrained model resnet50m_xent_prid.pth.tar which can only open using Microsoft Windows OS (I don’t know is true or not), but when I type file resnet50m_xent_prid.pth.tar got this message

resnet50m_xent_prid.pth.tar: 8086 relocatable (Microsoft)

How can I use that pretrained model on linux meanwhile pytorch can’t install on windows?

Thank you 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
lukasbrchlcommented, Apr 27, 2018

For Python 3, you have to edit torch/serialization.py file. Add this to line 469.

    _sys_info = pickle_module.load(f, encoding='latin1')
    unpickler = pickle_module.Unpickler(f, encoding='latin1')

image

1reaction
hsfzxjycommented, Nov 13, 2018

Now should be line 539 for pytorch 0.4.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix: "UnicodeDecodeError: 'ascii' codec can't decode ...
py", line 281, in convert source = unicode(source) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 1: ordinal not in range(128). --...
Read more >
UnicodeDecodeError: 'ascii' codec can't decode byte
UnicodeDecodeError : 'ascii' codec can't decode byte 0xf0 in position 0: ordinal not in range(128) with open('example.txt', 'r', encoding='ascii') as f: ...
Read more >
UnicodeDecodeError: 'ascii' codec can't decode byte - Intellipaat
py", line 281, in convert source = unicode(source) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 1: ordinal not in range( ...
Read more >
'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in ...
UnicodeDecodeError : 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)" in the Duo Authentication Proxy logs during Active...
Read more >
Converting Python 2 Pickles to Python 3 - Capsicum
... line 2, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0x95 in position 0: ordinal not in range(128).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found