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

Pre-trained model is not available #88

Open
Xiaomin-Li opened this issue Jun 17, 2022 · 2 comments
Open

Pre-trained model is not available #88

Xiaomin-Li opened this issue Jun 17, 2022 · 2 comments

Comments

@Xiaomin-Li
Copy link

Hi, I downloaded your pre-trained model from google drive. But it gives an error when loading the checkpoint.

----> 1 ckp = torch.load('./checkpoint_ssd300.pth.tar')

~/anaconda3/envs/PyTorch/lib/python3.8/site-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
591 return torch.jit.load(opened_file)
592 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
--> 593 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
594
595

~/anaconda3/envs/PyTorch/lib/python3.8/site-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
770 unpickler = pickle_module.Unpickler(f, **pickle_load_args)
771 unpickler.persistent_load = persistent_load
--> 772 result = unpickler.load()
773
774 deserialized_storage_keys = pickle_module.load(f, **pickle_load_args)

ModuleNotFoundError: No module named 'model'

@Ryan-Holmes-363
Copy link

You need to extract the zip first (I think) but I'm having issues with an archive header when I try to do so.

@sgrvinod
Copy link
Owner

You need to extract the zip first (I think) but I'm having issues with an archive header when I try to do so.

Hi, you do not need to extract it first; you've to load it directly with PyTorch as written in the code. I'm sorry about the misleading name (".tar") of the file, it's a naming convention that I picked up somewhere that is understandably confusing.

I think the first commenter had that issue because the checkpoint contains the model saved directly in its full form, i. e. not only the state/parameters (state_dict()) of the model. Therefore, it requires that the file containing the model definition, model.py, is in the same working directory when you load the checkpoint.

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

3 participants