Recently, I learned mxnet, by following the tutorials in mxnet.io
. In Handwritten Digit Recognition, I run the following code:
import mxnet as mx
mnist = mx.test_utils.get_mnist()
It shows:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-1-9ce98614649e> in <module>()
1 import mxnet as mx
----> 2 mnist=mx.test_utils.get_mnist()
/home/lthpc/mxnet/python/mxnet/test_utils.pyc in get_mnist()
1014 path = 'http://data.mxnet.io/data/mnist/'
1015 (train_lbl, train_img) = read_data(
-> 1016 path+'train-labels-idx1-ubyte.gz', path+'train-images-idx3-ubyte.gz')
1017 (test_lbl, test_img) = read_data(
1018 path+'t10k-labels-idx1-ubyte.gz', path+'t10k-images-idx3-ubyte.gz')
/home/lthpc/mxnet/python/mxnet/test_utils.pyc in read_data(label_url, image_url)
1002 def read_data(label_url, image_url):
1003 with gzip.open(mx.test_utils.download(label_url)) as flbl:
-> 1004 struct.unpack(">II", flbl.read(8))
1005 label = np.fromstring(flbl.read(), dtype=np.int8)
1006 with gzip.open(mx.test_utils.download(image_url), 'rb') as fimg:
error: unpack requires a string argument of length 8
How can I fix this?