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

error in run.py #26

Closed
SanSLee opened this issue Nov 22, 2018 · 5 comments
Closed

error in run.py #26

SanSLee opened this issue Nov 22, 2018 · 5 comments

Comments

@SanSLee
Copy link

SanSLee commented Nov 22, 2018

Traceback (most recent call last):
File "run.py", line 172, in
moduleNetwork = Network().cuda().eval()
File "run.py", line 124, in init
self.load_state_dict(torch.load('network-' + arguments_strModel + '.pytorch'))
File "/home/ubuntu/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/serialization.py", line 358, in load
return _load(f, map_location, pickle_module)
File "/home/ubuntu/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/serialization.py", line 532, in _load
magic_number = pickle_module.load(f)
_pickle.UnpicklingError: invalid load key, '<'.

When I run the file run.py, the error above occurred. Hope someone can help me.

@sniklaus
Copy link
Owner

It could be that the state dict got corrupted. The md5 hashes of them should be as follows.

ca2cea416fb99108bb08a8bfd31993cb  network-l1.pytorch
9121087a0550b77ebd6ae4100e4398a3  network-lf.pytorch

Can you check and see whether the md5 hashes of yours matches these?

@SanSLee
Copy link
Author

SanSLee commented Nov 23, 2018

Thanks! These two files have the same md5 value. That may be the problem and how can I solve it?

@sniklaus
Copy link
Owner

sniklaus commented Nov 23, 2018

I am afraid that I am confused. You said that your files have the same md5 hash and note that this could be the underlying problem. Did you mean to say that your files have different md5 hashes?

Should they differ then I would recommend downloading the models again. Should they match then you might want to consider the following discussion: CSAILVision/places365#25 (comment)

@sniklaus
Copy link
Owner

Are you behind a firewall that alters your downloads by chance?

@SanSLee
Copy link
Author

SanSLee commented Nov 23, 2018

The problem is that the model files were downloaded incompletely before. I download them again in another way. Thanks for your help and your wonderful work!

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