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

Fix error in publish_model.py for pt>=1.6 #291

Merged
merged 1 commit into from
May 7, 2021

Conversation

ckkelvinchan
Copy link
Member

According to the official PyTorch docs

The 1.6 release of PyTorch switched torch.save to use a new zipfile-based file format. torch.load still retains the 
ability to load files in the old format. If for any reason you want torch.save to use the old format, pass the kwarg 
_use_new_zipfile_serialization=False.

As a result, when using PyTorch version>=1.6 to publish models, errors occur when loading weights from URL. This PR fixes this error by adding _use_new_zipfile_serialization=False for torch.__version__ >= '1.6'

@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #291 (ae0fb3d) into master (3cfdd8f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #291   +/-   ##
=======================================
  Coverage   80.54%   80.54%           
=======================================
  Files         162      162           
  Lines        8091     8091           
  Branches     1192     1192           
=======================================
  Hits         6517     6517           
  Misses       1429     1429           
  Partials      145      145           
Flag Coverage Δ
unittests 80.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cfdd8f...ae0fb3d. Read the comment docs.

@innerlee innerlee merged commit c27f7e4 into open-mmlab:master May 7, 2021
@ckkelvinchan ckkelvinchan deleted the publish_model branch May 15, 2021 06:36
Yshuo-Li pushed a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants