Skip to content Skip to sidebar Skip to footer

Urllib.error.httperror: Http Error 403: Rate Limit Exceeded When Loading Resnet18 From Pytorch Hub

I am not sure why I get a rate limit error. (fashcomp) [jalal@goku fashion-compatibility]$ python main.py --test --l2_embed --resume runs/nondisjoint_l2norm/model_best.pth.tar --da

Solution 1:

This is a bug in Pytorch 1.9. As a workaround, try adding:

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

to your script before any torch.hub call. i.e.:

torch.hub._validate_not_a_forked_repo=lambda a,b,c: True
model = torch.hub.load('pytorch/vision:v0.9.0', 'resnet18', pretrained=True)

According to Philip Meier(one of the developers)'s post , This is a bug introduced in Pytorch 1.9 (#56138) and you shouldn't be facing this in older versions. This is already fixed in the master, but whether there is a 1.9.1 to have this shipped with is not known at the moment. So until 1.10 ships, you either have to use an older version or use torchvision instead or simply use the workaround proposed above.

Update:

Pytorch released a bugfix for 1.9 (i.e. 1.9.1) so updating to 1.9.1 should rectify this issue for good.

Post a Comment for "Urllib.error.httperror: Http Error 403: Rate Limit Exceeded When Loading Resnet18 From Pytorch Hub"