Downloading Fashion MNIST file in TensorFlow tutorial is taking forever

Viewed 302

I am trying to do this tutorial for a machine learning class I am taking in college.

www.tensorflow.org/tutorials/keras/basic_classification

When it executes the lines

 fashion_mnist = keras.datasets.fashion_mnist

 (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()

it is taking forever to download the data. At the rate it is downloading, it is going to take a few days or weeks to download all of it. I am using a MacBook. My classmate is also using a MacBook and when he downloads the data it only takes a few seconds. Please help.

1 Answers

In my case the download was giving me an error. By digging into the error I was able to find the file in which the base URL was declared, which in my case was:

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow_core/python/keras/datasets/fashion_mnist.py

At line 44 I have commented out the line:

# base = 'https://storage.googleapis.com/tensorflow/tf-keras-datasets/'

And declared a different base URL, which I had found looking into the documentation of the original dataset:

base = 'http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/'

The download started immediately and gave no errors. Hope this helps.

Related