Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Something wrong when I ran the example of image-classification #4172

Closed
Qingmu opened this issue Dec 9, 2016 · 4 comments
Closed

Something wrong when I ran the example of image-classification #4172

Qingmu opened this issue Dec 9, 2016 · 4 comments

Comments

@Qingmu
Copy link

Qingmu commented Dec 9, 2016

I just installed mxnet in my Banana Pi, and wanted to test it. While I ran the example in image-classification, it didn't work. I cannot find the reason for my first try with mxnet. Does someone know what happens?

When I ran the code (without gup):

python train_cifar10.py --network resnet --num-layers 110 --batch-size 128 --gpus ‘’

I got:

ValueError: invalid literal for int() with base 10: '\xe2\x80\x98\xe2\x80\x99'

While I ran the example:

python train_mnist.py --network mlp

I got:

IOError: CRC check failed 0x6d9b6e54 != 0x85c4e58dL

Environment info

Operating System:
debian 8 in Banana Pi

Package used (Python/R/Scala/Julia):
Python

MXNet commit hash (git rev-parse HEAD):
7907e45

Python version and distribution:
2.7.9

Error Message:

root@armbian:~/mxnet/example/image-classification# python train_cifar10.py --network resnet --num-layers 110 --batch-size 128 --gpus ‘’
INFO:root:start with arguments Namespace(batch_size=128, benchmark=0, data_nthreads=4, data_train='data/cifar10_train.rec', data_val='data/cifar10_val.rec', disp_batches=20, gpus='\xe2\x80\x98\xe2\x80\x99', image_shape='3,28,28', kv_store='device', load_epoch=None, lr=0.1, lr_factor=0.1, lr_step_epochs='200,250', max_random_aspect_ratio=0, max_random_h=36, max_random_l=50, max_random_rotate_angle=0, max_random_s=50, max_random_scale=1, max_random_shear_ratio=0, min_random_scale=1, model_prefix=None, mom=0.9, network='resnet', num_classes=10, num_epochs=300, num_examples=50000, num_layers=110, optimizer='sgd', pad_size=4, random_crop=1, random_mirror=1, rgb_mean='123.68,116.779,103.939', test_io=0, top_k=0, wd=0.0001)
[22:44:45] src/io/iter_image_recordio.cc:221: ImageRecordIOParser: data/cifar10_train.rec, use 1 threads for decoding..
[22:44:47] src/io/iter_image_recordio.cc:221: ImageRecordIOParser: data/cifar10_val.rec, use 1 threads for decoding..
Traceback (most recent call last):
File "train_cifar10.py", line 53, in
fit.fit(args, sym, data.get_rec_iter)
File "/root/mxnet/example/image-classification/common/fit.py", line 131, in fit
mx.gpu(int(i)) for i in args.gpus.split(',')]
ValueError: invalid literal for int() with base 10: '\xe2\x80\x98\xe2\x80\x99'

root@armbian:~/mxnet/example/image-classification# python train_mnist.py --network mlp
INFO:root:start with arguments Namespace(batch_size=64, disp_batches=100, gpus=None, kv_store='device', load_epoch=None, lr=0.1, lr_factor=0.1, lr_step_epochs='10', model_prefix=None, mom=0.9, network='mlp', num_classes=10, num_epochs=20, num_examples=60000, num_layers=None, optimizer='sgd', test_io=0, top_k=0, wd=0.0001)
Traceback (most recent call last):
File "train_mnist.py", line 76, in
fit.fit(args, sym, get_mnist_iter)
File "/root/mxnet/example/image-classification/common/fit.py", line 103, in fit
(train, val) = data_loader(args, kv)
File "train_mnist.py", line 41, in get_mnist_iter
't10k-labels-idx1-ubyte.gz', 't10k-images-idx3-ubyte.gz')
File "train_mnist.py", line 24, in read_data
image = np.fromstring(fimg.read(), dtype=np.uint8).reshape(len(label), rows, cols)
File "/usr/lib/python2.7/gzip.py", line 261, in read
self._read(readsize)
File "/usr/lib/python2.7/gzip.py", line 315, in _read
self._read_eof()
File "/usr/lib/python2.7/gzip.py", line 354, in _read_eof
hex(self.crc)))
IOError: CRC check failed 0x6d9b6e54 != 0x85c4e58dL

@piiswrong
Copy link
Contributor

@mli

@mli
Copy link
Member

mli commented Dec 9, 2016

the first error seems to be --gpus is not given ascii input
the second probably due to the download of mnist is failed, please remove the the mnist data in ./data and try it again

@ysh329
Copy link
Contributor

ysh329 commented Mar 25, 2017

You can try solution below:

IOError of train_mnist.py :( · Issue #4285 · dmlc/mxnet
#4285

@yajiedesign
Copy link
Contributor

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

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

No branches or pull requests

5 participants