Skip to content

SSL: CERTIFICATE_VERIFY_FAILED Solution while downloading CIFAR10 #87

Open
@naiborhujosua

Description

@naiborhujosua

For anyone who is getting errors while downloading CIFAR-10, you can use this trick

## by turning off SSL verification 
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

from torchvision import datasets, transforms
data_path = '../data-unversioned/p1ch7/'
cifar10 = datasets.CIFAR10(
    data_path, train=True, download=True,
    transform=transforms.Compose([
        transforms.ToTensor(),
        transforms.Normalize((0.4915, 0.4823, 0.4468),
                             (0.2470, 0.2435, 0.2616))
    ]))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions