cvlab-stonybrook / DM-Count

Code for NeurIPS 2020 paper: Distribution Matching for Crowd Counting.
MIT License
217 stars 52 forks source link

I had an error loading your pre-training model #7

Closed liang-jingyi closed 3 years ago

liang-jingyi commented 3 years ago

There was an error when i was training or testing models in the (pretrained_models) folder

File "/home/user/Documents/LJY/DM-Count/test.py", line 49, in model.load_state_dict(torch.load(model_path, device), strict=False) File "/home/user/anaconda3/lib/python3.6/site-packages/torch/serialization.py", line 386, in load return _load(f, map_location, pickle_module, pickle_load_args) File "/home/user/anaconda3/lib/python3.6/site-packages/torch/serialization.py", line 563, in _load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

I didn't make any mistakes when i experimented with the model i had trained. Thank you very much for your work. It helped me a lot Please help me. Thank you! 修改翻译结果

Boyu-Wang commented 3 years ago

This is a Pytorch version mismatch problem. The model is trained using Pytorch 1.2. Try loading the model with the same Pytorch.

liang-jingyi commented 3 years ago

Hello, I have confirmed that my Pytorch version is 1.2, but there is still an error

Boyu-Wang commented 3 years ago

Did you use the model cloned from Github directly? Since the model is too big, when you git clone the repo, the file in model are not the correct one, there are too big to be download by git, there are replace by text file. You can either download them with git-lfs, or download from Google Drive directly.