TorchStudio / torchstudio

IDE for PyTorch and its ecosystem
https://torchstudio.ai
MIT License
383 stars 27 forks source link

URLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed #19

Closed yewentao256 closed 2 years ago

yewentao256 commented 2 years ago

When referring to the tutorial 2:transfer learning Can't load the dataset CIFAR 10

it shows: File C:\Users\Peter\TorchStudio\python\lib\urllib\request.py, line 1349, in do_open raise URLError(err) URLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)

The version of torchstudio: v0.9.5

divideconcept commented 2 years ago

I can't repro here, but seems to be the same issue as: https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error Considering PyTorch/torchvision is doing its own cooking to download data, it seems the only solution to that issue would be to edit C:\Users\Peter\TorchStudio\torchstudio\datasetload.py and add these lines at the very beginning of the file:

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

Let me know how it goes on your side.

yewentao256 commented 2 years ago

Now it works, thanks a lot~

divideconcept commented 2 years ago

Fixed in TorchStudio 0.9.7