0

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?

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
West
  • 13
  • 5

1 Answers1

1

It seems like you are using an older version of MXNet. Are you able to reproduce this with the latest release of MXNet. Please provide reproduction steps for the issue including the environment that you are running it on.

hungrypanda
  • 101
  • 2
  • My mxnet version is 0.11.0,and run it on the ubuntu14.04,python 2.7,It's strange that other examples from mxnet tutorials is OK...only this one report such error.. – West Oct 30 '17 at 00:33