当前位置:网站首页>(the slow download speed of cifar10 in torchvision has been solved) how to download and use torchvision import

(the slow download speed of cifar10 in torchvision has been solved) how to download and use torchvision import

2022-06-11 08:10:00 Interval


background

    train_set = torchvision.datasets.CIFAR10(root='./data', train=True,
                                             download=True, transform=transform)

Super slow , Too slow to report errors directly :

urllib.error.URLError: urlopen error [Errno 11001] getaddrinfo failed


Solution

The official website is super fast http://www.cs.toronto.edu/~kriz/cifar.html
Download the first one :

 Insert picture description here
Unzip it , Then the directory will look like this

cifar-10-python/cifar-10-batches-py/*

among * Number is the following files .
 Insert picture description here
We just need to copy the above files to data Under the table of contents :

data/cifar-10-batches-py/*

And then use torchvision Handle , And set up download=False that will do .

    train_set = torchvision.datasets.CIFAR10(root='./data', train=True,
                                             download=False, transform=transform)

success .

原网站

版权声明
本文为[Interval]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020514399773.html