Open fkoehlin opened 3 years ago
This issue may have been solved in lastest main branch.
https://github.com/pytorch/pytorch/blob/b6df043f1fa31f37c4b205eb4083918b919751ff/torch/hub.py#L114
For old version(e.g., 1.9.1), change line MASTER_BRANCH = 'master'
to MASTER_BRANCH = 'main'
in file <PYTHON-ENV>/site-packages/torch/hub.py
can solve this problem, if the target repo's main branch has renamed from master to main.
https://github.com/pytorch/pytorch/blob/880c811aeb6937a44d5cc700ab3d802f95538aa9/torch/hub.py#L58
🐛 Bug
Trying to load various transformer-based models for translations as documented in several READMEs (see below) with
torch.hub.load
fails.For PyTorch version 1.8.1 (from
pip
): The stepDownloading: "https://github.com/pytorch/fairseq/archive/master.zip"
fails with an HTTP Error 404:urllib.error.HTTPError: HTTP Error 404: Not Found
Using PyTorch version 1.9.1 (from
pip
) instead yields the following error message:ValueError: Cannot find master in https://github.com/pytorch/fairseq. If it's a commit from a forked repo, please call hub.load() with forked repo directly.
To Reproduce
The following snippets are all copy&pasted from READMEs.
or
or
Code sample
Expected behavior
Models should be downloaded to local cache so that translation can be started.
Environment
pip
, source): pipAdditional context
N/A