HTTP error 403 downloading cnn

So I get this error when trying to run the code in the box in lesson 1. It worked yesterday and I believe I have done everything the same. I’m using colab.


I tried running the code in lesson3-imdb up to and including this line:
learn = language_model_learner(data_lm, AWD_LSTM, drop_mult=0.3)
and it runs fine.

How can I use the cnn?

Hey Alice I have the same problem downloading ResNet34. I have tried to manually call the model architecture by manipulating the source code or even directed the cnn_config function to the arch file but no achievement yet! Let me know if you find any solution!

Hey all, I’m also getting the same issue.

In the meanwhile, to unblock you…you can download the model manually from pytorch to disk, upload it to colab and move it to the directory in the stack trace. Or better, download it straight to colab. Just use the link to download on the error trace.

I’m suspecting it could be related to urllib. I’ve seen a few threads related to the choice of header causing the website to think we’re robots. Anyone have any other thoughts?

Do you know what directory we should move the manually download architecture? I guess even if we download it manually running the model building code would request anyway and stops running! What do you think?

You can copy it to the directory in the error message (/root/.cache/…) like Andre suggested. I ran into the same error and that seems to work for me. I downloaded the file manually, uploaded it and moved it to that directory. Then the code runs ok.

That worked! Thanks!
For those who are reading this discussion I used following command on terminal
cp [manually downloaded model arch which is already uploaded on jupyter] [/root/.cache/torch/checkpoints] and again ran the code and worked!

1 Like

Hi, you can run the following command from colab, replacing the url with your model url:

!cd /root/.cache/torch/checkpoints && curl -O https://download.pytorch.org/models/resnet50-19c8e357.pth

This will download the model straight to colab, in the right directory. I’s much faster than downloading to disk. Hope it helps!

8 Likes

Thank you so much!

This is absolutely fantastic, thank you!

For those wanting the links, replace vgg with resnet, etc:

https://pytorch.org/docs/stable/_modules/torchvision/models/vgg.html

This is where I went to get said URL

2 Likes

Thank you.

Thanks! This works perfectly!

Problem seems to have been fixed. Models downloading normally again for me without the workaround.

1 Like

FYI I had to manually create the torch/checkpoints folder under /root/.cache to download the model.
Then things worked.