pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
15.73k stars 6.88k forks source link

FashionMNIST Download issue #4829

Open harishsdev opened 2 years ago

harishsdev commented 2 years ago

🐛 Bug

Unable to download MNIST Dataset as per pytorch Documentation

https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html

To Reproduce

import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision import datasets
from torchvision.transforms import ToTensor, Lambda, Compose
import matplotlib.pyplot as plt

training_data = datasets.FashionMNIST(
    root="data",
    train=True,
    download=True,
    transform=ToTensor(),
)

Error message is below

Downloading http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz
Failed to download (trying next):
<urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
RuntimeError                              Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_8408/1648373759.py in <module>
      6 import matplotlib.pyplot as plt
      7 
----> 8 training_data = datasets.FashionMNIST(
      9     root="data",
     10     train=True,

G:\ineuronai\o\envs\odtf\lib\site-packages\torchvision\datasets\mnist.py in __init__(self, root, train, transform, target_transform, download)
     83 
     84         if download:
---> 85             self.download()
     86 
     87         if not self._check_exists():

G:\ineuronai\o\envs\odtf\lib\site-packages\torchvision\datasets\mnist.py in download(self)
    167                 break
    168             else:
--> 169                 raise RuntimeError("Error downloading {}".format(filename))
    170 
    171         # process and save as torch files

RuntimeError: Error downloading train-images-idx3-ubyte.gz

Expected behavior

cc @fmassa @vfdev-5 @pmeier @brianjo @mruberry

mruberry commented 2 years ago

@fmassa -- maybe a transient networking issue?

Should this be moved to the torchvision repo?

pmeier commented 2 years ago

Hey @harishsdev, I'm unable to reproduce this locally. Our download tests also succeeded today. Maybe it was just a fluke? Could you retry if it works for you now?

brianjo commented 2 years ago

@harishsdev Running this on colab seems to succeed without issues. Is this the same for you?

https://colab.research.google.com/github/pytorch/tutorials/blob/gh-pages/_downloads/c30c1dcf2bc20119bcda7e734ce0eb42/quickstart_tutorial.ipynb.

If it is, I would suspect a local issue.

HaiyanJiang commented 2 years ago
  1. Running this on colab seems to succeed without issues.

https://colab.research.google.com/github/pytorch/tutorials/blob/gh-pages/_downloads/c30c1dcf2bc20119bcda7e734ce0eb42/quickstart_tutorial.ipynb

  1. Then create and download the .zip file from the colab.
    # First, create a zip file:
    !zip -r /content/file.zip /content/data
    # Then, downlod that zip file:
    from google.colab import files
    files.download("/content/file.zip")
ronaldpetty commented 5 months ago

I also had it fail to download. Oddly enough, it never showed an error which made me think it was some issue with the kernel. I restarted it and it failed again (again with no error). I watched the network and there didn't seem to be any activity. I then enabled debugging and it started working. While the prior details don't sound like it, I suspect a temp network issue, but plan on keeping an eye out better for it.