-
Notifications
You must be signed in to change notification settings - Fork 305
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
First time training, HTTP Error 403: Forbidden?! #148
Comments
same issue, but in load_pretrained_weights. When you actually try and open the weights link you get:
|
i have a same problem when run demo.py on pytorch-1.4.0, torchvisoin 0.5.0. i use command i downloaded pre-traiend model form google drive, but demo.py tried download pre-trained, and occurred same problem. below is error.
|
Looks like the pretrained weight urls have gone bad. |
Replace the url_map in model/utils.py with: url_map = {
'efficientnet-b0': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b0-355c32eb.pth',
'efficientnet-b1': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b1-f1951068.pth',
'efficientnet-b2': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b2-8bb594d6.pth',
'efficientnet-b3': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b3-5fb5a3c3.pth',
'efficientnet-b4': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b4-6ed6700e.pth',
'efficientnet-b5': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b5-b6417697.pth',
'efficientnet-b6': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b6-c76e70fd.pth',
'efficientnet-b7': 'https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b7-dcc49843.pth',
} These links work. |
Same problem. Just created a pull request to fix the links. |
loading annotations into memory...
Done (t=10.57s)
creating index...
index created!
loading annotations into memory...
Done (t=0.33s)
creating index...
index created!
Downloading: "http://storage.googleapis.com/public-models/efficientnet/efficientnet-b0-355c32eb.pth" to /home/itandroids/.cache/torch/checkpoints/efficientnet-b0-355c32eb.pth
Traceback (most recent call last):
File "train.py", line 335, in
main()
File "train.py", line 331, in main
main_worker(args.gpu, ngpus_per_node, args)
File "train.py", line 232, in main_worker
D_class=EFFICIENTDET[args.network]['D_class']
File "/home/itandroids/Desktop/eficientedet/toandao/models/efficientdet.py", line 33, in init
self.backbone = EfficientNet.from_pretrained(MODEL_MAP[network])
File "/home/itandroids/Desktop/eficientedet/toandao/models/efficientnet.py", line 243, in from_pretrained
model, model_name, load_fc=(num_classes == 1000))
File "/home/itandroids/Desktop/eficientedet/toandao/models/utils.py", line 319, in load_pretrained_weights
state_dict = model_zoo.load_url(url_map[model_name])
File "/home/itandroids/Desktop/eficientedet/toandao/lib/python3.6/site-packages/torch/hub.py", line 492, in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "/home/itandroids/Desktop/eficientedet/toandao/lib/python3.6/site-packages/torch/hub.py", line 391, in download_url_to_file
u = urlopen(url)
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
The text was updated successfully, but these errors were encountered: