Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFError, loading MNIST data #2572

Closed
colin-ni opened this issue May 1, 2016 · 9 comments
Closed

EOFError, loading MNIST data #2572

colin-ni opened this issue May 1, 2016 · 9 comments

Comments

@colin-ni
Copy link

colin-ni commented May 1, 2016

I get the following error when running the script under examples/mnist_cnn (https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py):

line 337, in
...(X_train, y_train), (X_test, y_test) = mnist.load_data()
File "C:\Users\Colin\Miniconda3\lib\site-packages\keras\datasets\mnist.py", line 19, in load_data
...data = cPickle.load(f, encoding="bytes")
File "C:\Users\Colin\Miniconda3\lib\gzip.py", line 596, in readline
...c = self.read(readsize)
File "C:\Users\Colin\Miniconda3\lib\gzip.py", line 365, in read
...if not self._read(readsize):
File "C:\Users\Colin\Miniconda3\lib\gzip.py", line 449, in _read
...self._read_eof()
File "C:\Users\Colin\Miniconda3\lib\gzip.py", line 482, in _read_eof
...crc32, isize = struct.unpack("<II", self._read_exact(8))
File "C:\Users\Colin\Miniconda3\lib\gzip.py", line 286, in _read_exact
...raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached

I'm running the latest Theano and Keras, Python 3.4.

@colin-ni
Copy link
Author

colin-ni commented May 1, 2016

Similar problem in #2519 -- same module (gzip) but different errors.

@joelthchao
Copy link
Contributor

Probably due to in-completed download file, try to remove downloaded file (usually in ~/.keras/ or /tmp/.keras/) and run again.

@colin-ni
Copy link
Author

colin-ni commented May 2, 2016

Works now. I deleted mnist.pkl in /.keras/datasets/. Thanks!

@colin-ni colin-ni closed this as completed May 2, 2016
@laubonghaudoi
Copy link

Where is the ~/.keras/ path? I can't find this folder.

@toluwajosh
Copy link

@laubonghaudoi if you're using windows.. simply use PowerShell instead of comand prompt and type:cd ~/.keras/datasets

You should also be able to navigate using explorer to the .keras folder located in your username folder. However, I find that PowerShell is easier (if you installed keras correctly).

@psamim
Copy link

psamim commented Nov 1, 2016

You can also manually download mnist-dataset from https://s3.amazonaws.com/img-datasets/mnist.pkl.gz and put it into ~/.keras/datasets .

@Fishtang01
Copy link

Hi passim, i am on a mac. I have a hard time auto download the file because it keeps timing it out. so I manually download it. now I have the file .keras/datasets/mnist.npz in the .keras dirctory. it's still not loading from the file, and it keeps want to auto download from https:/......

do i need to change the path name? thanks for helping.

@Fishtang01
Copy link

i figured it out. i used a different IDE to download the datasets.

@YacheLee
Copy link

YacheLee commented Mar 6, 2019

I solved by restarting my computer...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants