【发布时间】:2021-10-24 07:31:51
【问题描述】:
我不确定为什么会收到速率限制错误。
(fashcomp) [jalal@goku fashion-compatibility]$ python main.py --test --l2_embed --resume runs/nondisjoint_l2norm/model_best.pth.tar --datadir ../../../data/fashion
/scratch3/venv/fashcomp/lib/python3.8/site-packages/torchvision/transforms/transforms.py:310: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
warnings.warn("The use of the transforms.Scale transform is deprecated, " +
Traceback (most recent call last):
File "main.py", line 313, in <module>
main()
File "main.py", line 105, in main
model = torch.hub.load('pytorch/vision:v1.9.0', 'resnet18', pretrained=True)
File "/scratch3/venv/fashcomp/lib/python3.8/site-packages/torch/hub.py", line 362, in load
repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, verbose)
File "/scratch3/venv/fashcomp/lib/python3.8/site-packages/torch/hub.py", line 162, in _get_cache_or_reload
_validate_not_a_forked_repo(repo_owner, repo_name, branch)
File "/scratch3/venv/fashcomp/lib/python3.8/site-packages/torch/hub.py", line 124, in _validate_not_a_forked_repo
with urlopen(url) as r:
File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: rate limit exceeded
我有:
$ pip freeze
h5py==3.3.0
joblib==1.0.1
numpy==1.21.2
Pillow==8.3.1
scikit-learn==0.24.2
scipy==1.7.1
sklearn==0.0
threadpoolctl==2.2.0
torch==1.9.0
torchaudio==0.9.0
torchvision==0.10.0
typing-extensions==3.10.0.0
【问题讨论】:
-
在这里尝试旧版本的 pytorch 或任何其他建议的修复github.com/pytorch/vision/issues/4156 ?
-
我需要使用 1.9.0
-
你能用 torchvision.model 代替 torch.hub 吗?
-
当我这样做时,我得到了这个错误` state_dict中的意外键:“embeddingnet.embeddingnet.fc_embed.weight”,“embeddingnet.embeddingnet.fc_embed.bias”。 `
-
我认为您尝试加载的状态可能与您尝试使用的模型不同?好像有不同的层?
标签: python pytorch torch http-error