Skip to content

Conversation

@ailzhang
Copy link
Contributor

Fixes #42239

@dr-ci
Copy link

dr-ci bot commented Jul 30, 2020

💊 CI failures summary and remediations

As of commit 9d5e4ef (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



🚧 1 ongoing upstream failure:

These were probably caused by upstream breakages that are not fixed yet:


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 10 times.

@ailzhang ailzhang requested review from gchanan and soumith July 31, 2020 16:07
@gchanan gchanan requested a review from jamesr66a July 31, 2020 18:43
@gchanan
Copy link
Contributor

gchanan commented Jul 31, 2020

@jamesr66a can you review?

Copy link
Collaborator

@jamesr66a jamesr66a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM barring one thing

torch/hub.py Outdated
# then fall back to the old way if that fails.
try:
return torch.load(cached_file, map_location=map_location)
except RuntimeError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not thrilled that this catches any RuntimeError. Is it possible for us to define a torch.is_loadable or something that checks specifically for that condition? Otherwise this seems fine

torch/hub.py Outdated
with zipfile.ZipFile(cached_file) as cached_zipfile:
members = cached_zipfile.infolist()
if len(members) != 1:
raise RuntimeError('Only one file(not dir) is allowed in the zipfile')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we change some documentation or something to not recommend this file format anymore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also maybe change the RuntimeError (if this is no longer the recommended serialization option) for something like: "Falling back to old format...". Because otherwise users will see this error if they say, try to load a corrupted new format, right?

@ailzhang ailzhang force-pushed the fix_hub_load_zipfile branch from 6a603ff to f48a46c Compare August 18, 2020 21:09
@ailzhang ailzhang force-pushed the fix_hub_load_zipfile branch from f48a46c to 9d5e4ef Compare August 18, 2020 21:14
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ailzhang merged this pull request in 51bab08.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch.hub.load_state_dict_from_url() is not able to load the new zipfile serialization files

5 participants