当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Why do I get EOFError error when trying to read MNIST data?

问题描述:

import cPickle, gzip, numpy

data = cPickle.load(gzip.open('mnist.pkl.gz', 'rb'))

trndata=data['train']

tstdata=data['test']

I was getting this error when I was running this code :

Traceback (most recent call last):

File "/home/converge_2_min/trainer.py", line 12, in <module>

data = cPickle.load(gzip.open('mnist.pkl.gz', 'rb'))

EOFError

网友答案:

I have the same problem on Cygwin and anaconda on windows. Here is my pkl file (Cygwin) $ md5sum mnist.pkl.gz a02cd19f81d51c426d7ca14024243ce9 *mnist.pkl.gz

Unzipped: $ md5sum mnist.pkl 533096469a4f4dbb70a78fdee468939a *mnist.pkl

On Ubuntu: $ md5sum mnist.pkl 533096469a4f4dbb70a78fdee468939a mnist.pkl

So it seems to be an issue with cPickle on windows-based python installs.

分享给朋友:
您可能感兴趣的文章:
随机阅读: