594422814 / UDT_pytorch

MIT License
191 stars 23 forks source link

Can't load pretrained models #19

Closed mphillips-valleyit closed 3 years ago

mphillips-valleyit commented 3 years ago

When I run the test command

python UDT.py --model ../train/work/checkpoint.pth.tar

I get

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdb in position 0: invalid continuation byte

in load_param of track/net.py. Using PyTorch 1.6, Python 3.6. Same result with PyTorch 0.4. Any thoughts on why it won't work? I note that the model files seem really small (83K).

zzapzzap commented 3 years ago

Same here

zzapzzap commented 3 years ago

Hi, @mphillips-valleyit I solved problem.

At the 64th line of 'track/net.py', modify checkpoint = torch.load(path, encoding='ISO-8859-1')

But I don't know why the encoder 'utf-8' has a problem.

mphillips-valleyit commented 3 years ago

Nice work @zzapzzap ! Your change solved it for me as well.