赞
踩
repo_or_dir = _get_cache_or_reload(repo_or_dir, force_reload, verbose)
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\site-packages\torch\hub.py", line 162, in _get_cache_or_reload
_validate_not_a_forked_repo(repo_owner, repo_name, branch)
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\site-packages\torch\hub.py", line 124, in _validate_not_a_forked_repo
with urlopen(url) as r:
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\urllib\request.py", line 640, in http_response
response = self.parent.error(
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\urllib\request.py", line 502, in _call_chain
result = func(*args)
File "D:\ProgramData\Anaconda3\envs\torchenv\lib\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
设置 torch.hub._validate_not_a_forked_repo=lambda a,b,c: True即可
- import torch
- torch.hub._validate_not_a_forked_repo=lambda a,b,c: True
- model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet50', pretrained=True,force_reload=True)
- # or any of these variants
- # model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)
- # model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_mobilenet_v3_large', pretrained=True)
- model.eval()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。