Skip to content

I got an error when loading deeplabv3_resnet101. #4277

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

Closed
tuxxon opened this issue Aug 16, 2021 · 1 comment
Closed

I got an error when loading deeplabv3_resnet101. #4277

tuxxon opened this issue Aug 16, 2021 · 1 comment

Comments

@tuxxon
Copy link

tuxxon commented Aug 16, 2021

🐛 Bug

I got the error when running model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)

To Reproduce

Steps to reproduce the behavior:

  1. Click the url below:
    https://colab.research.google.com/github/pytorch/pytorch.github.io/blob/master/assets/hub/pytorch_vision_deeplabv3_resnet101.ipynb
  2. Click the first cell
import torch
model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)
model.eval()

Expected behavior

Normal works.

but, I got this error:

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
<ipython-input-2-90f9efc58017> in <module>()
      1 import torch
----> 2 model = torch.hub.load('pytorch/vision:v0.10.0', 'deeplabv3_resnet101', pretrained=True)
      3 model.eval()

8 frames
/usr/lib/python3.7/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
    647 class HTTPDefaultErrorHandler(BaseHandler):
    648     def http_error_default(self, req, fp, code, msg, hdrs):
--> 649         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    650 
    651 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: rate limit exceeded

Environment

Jupyter notebook with Python3

@tuxxon tuxxon changed the title I got the error when loading deeplabv3_resnet101. I got an error when loading deeplabv3_resnet101. Aug 16, 2021
@NicolasHug
Copy link
Member

NicolasHug commented Aug 16, 2021

Thanks for the report, this is a known issue that should be fixed in the next version. I'll close as a duplicate of #4156 and pytorch/pytorch#61755

In your specific case, could you try to load the model directly from torchvision instead:

model = torchvision.models.deeplabv3_resnet101(pretrained=True, progress=True)

This will only be equivalent if you have torchvision 0.10 though.

Otherwise you can also set

torch.hub._validate_not_a_forked_repo=lambda a,b,c: True

as described in pytorch/pytorch#61755 (comment)

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

No branches or pull requests

2 participants