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

[ci] Unpickling error for pretrained parameter loading #36

Closed
frgfm opened this issue Oct 23, 2019 · 1 comment
Closed

[ci] Unpickling error for pretrained parameter loading #36

frgfm opened this issue Oct 23, 2019 · 1 comment
Assignees
Labels
ext: tests Related to tests help wanted Extra attention is needed
Milestone

Comments

@frgfm
Copy link
Member

frgfm commented Oct 23, 2019

🐛 Bug

The pretrained=True option on models cannot be tested by CI, since passing it produces a pickle error that cannot be reproduced locally.

To Reproduce

Steps to reproduce the behavior:

  1. Running the pkg-test CI job on this commit

which produces:

Traceback (most recent call last):
  File "/home/circleci/repo/test/test_models.py", line 22, in test_resnet
    model = models.resnet(depth=18, pretrained=True, bin_classif=True).eval()
  File "/home/circleci/repo/pyronear/models/resnet.py", line 49, in resnet
    progress=progress)
  File "/home/circleci/repo/venv/lib/python3.6/site-packages/torch/hub.py", line 499, in load_state_dict_from_url
    return torch.load(cached_file, map_location=map_location)
  File "/home/circleci/repo/venv/lib/python3.6/site-packages/torch/serialization.py", line 426, in load
    return _load(f, map_location, pickle_module, **pickle_load_args)
  File "/home/circleci/repo/venv/lib/python3.6/site-packages/torch/serialization.py", line 603, in _load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'Y'.

Expected behavior

State dictionary loading should not produce errors.

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/frgfm/PyroNear/master/pyronear/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch Version: 1.3.0
  • Torchvision Version: 0.4.1a0+d94043a
  • OS: Ubuntu 18.04
  • How you installed PyTorch: conda
  • Python version: 3.7
  • CUDA/cuDNN version: CUDA 10.1.168 / cuDNN 7.6.2
  • GPU models and configuration: GeForce GTX 1050 (driver: 430.50)
@frgfm frgfm added help wanted Extra attention is needed ext: tests Related to tests module: ci labels Oct 23, 2019
frgfm added a commit that referenced this issue Oct 23, 2019
Apparently there is a pickle error on CI that currently prevents pretrained parameter loading. See #36
@frgfm frgfm added this to the 0.1.1 milestone Oct 23, 2019
@frgfm frgfm added this to To do in PyroNear kanban via automation Oct 23, 2019
frgfm added a commit that referenced this issue Oct 23, 2019
* feat: Added models module

Added a first resnet to the models module with a pretrained parameter loading option. Closes #22

* docs: Added models to documentation

* test: Fixed tester naming

* test: Added unittest for models

* test: Removed pretrained test

Apparently there is a pickle error on CI that currently prevents pretrained parameter loading. See #36

* fix: Fixed typo in resnet

* chore: Updated package version

Switched from beta to release candidate 1, updated description, classifiers, and keywords.

* docs: Fixed typo

* chore: Updated intermediate import
@frgfm frgfm self-assigned this May 12, 2020
@frgfm
Copy link
Member Author

frgfm commented May 12, 2020

This issue seems to have been fixed a while back, I'm not able to reproduce it anymore.
Closing for now, feel free to reopen if you encounter it!

@frgfm frgfm closed this as completed May 12, 2020
PyroNear kanban automation moved this from To do to Done May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: tests Related to tests help wanted Extra attention is needed
Projects
Development

No branches or pull requests

1 participant