DEV Community

satish
satish

Posted on

1 1

Pytorch MNIST Dataset Error

There seems to be some problem with the Hosting, and the Pytorch team is solving the following issue.

Use this code to solve the issue. It provides a new mirror to download the dataset.

from torchvision import datasets,transforms
new_mirror = 'https://ossci-datasets.s3.amazonaws.com/mnist'
datasets.MNIST.resources = [
   ('/'.join([new_mirror, url.split('/')[-1]]), md5)
   for url, md5 in datasets.MNIST.resources
]
train_dataset = datasets.MNIST(
   "../data", train=True, download=True, transform=transforms.Totensor()
)
Enter fullscreen mode Exit fullscreen mode

Courtesy: https://stackoverflow.com/questions/66577151/http-error-when-trying-to-download-mnist-data

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay