michuanhaohao / AlignedReID

Alignedreid++: Dynamically Matching Local Information for Person Re-Identification.
MIT License
401 stars 114 forks source link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 0: #46

Open RisithPerera opened 3 years ago

RisithPerera commented 3 years ago

When I try to run the demo it produces this error. Traceback (most recent call last): File "Alignedreid_demo.py", line 26, in <module> checkpoint = torch.load("./market1501/checkpoint_ep300.pth.tar") File "C:\Anaconda\lib\site-packages\torch\serialization.py", line 585, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "C:\Anaconda\lib\site-packages\torch\serialization.py", line 765, in _legacy_load result = unpickler.load() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 0: invalid continuation byte

I'm using - Pytorch - 1.6.0 torchvision - 0.7.0

hy0523 commented 3 years ago

Hello,You can try torch.load("./market1501/checkpoint_ep300.pth.tar", encoding='unicode_escape')

lilingdu commented 2 years ago

@ghy990523 ,hello, I had tried the method "torch.load("./market1501/checkpoint_ep300.pth.tar", encoding='unicode_escape')" ,but it was not working , and occured new error ,"'enconding is an invalid keyword argument for load()", can you help here?thanks in advance.

ldknight commented 2 years ago

Hello,you can try checkpoint = torch.load("./log/market1501/alignedreid/checkpoint_ep300.pth.tar",encoding = 'latin1')