mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

AssertionError: Data must be list of NDArrays

Open Heidisnaps opened this issue 9 years ago • 11 comments

For bugs or installation issues, please provide the following information. The more information you provide, the more likely people will be able to help you.

Environment info

Operating System: Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiler:

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

MXNet version: mxnet-0.11.1-py3.5.egg MXNet commit hash (git rev-parse HEAD): 0c66eff04590c5c41a743a196283d766aab04f9b

If you are using python package, please provide

Python version and distribution: Python 3.5.3 :: Anaconda custom (64-bit)

Error Message:

~incubator-mxnet/example/ssd$ python demo.py --cpu --network resnet50 --data-shape 512

prefix /home/ubuntu/heidi/git_project/incubator-mxnet/example/ssd/model/ssd_resnet50_5 [01:10:12] src/nnvm/legacy_json_util.cc:190: Loading symbol saved by previous version v0.10.1. Attempting to upgrade... [01:10:12] src/nnvm/legacy_json_util.cc:198: Symbol successfully upgraded! Exception in thread Thread-1: Traceback (most recent call last): File "/home/ubuntu/anaconda3/envs/mxnet_ssd/lib/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/home/ubuntu/anaconda3/envs/mxnet_ssd/lib/python3.5/threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "/home/ubuntu/anaconda3/envs/mxnet_ssd/lib/python3.5/site-packages/mxnet-0.11.1-py3.5.egg/mxnet/io.py", line 394, in prefetch_func self.next_batch[i] = self.iters[i].next() File "/home/ubuntu/heidi/git_project/incubator-mxnet/example/ssd/dataset/iterator.py", line 215, in next pad=self.getpad(), index=self.getindex()) File "/home/ubuntu/anaconda3/envs/mxnet_ssd/lib/python3.5/site-packages/mxnet-0.11.1-py3.5.egg/mxnet/io.py", line 155, in init assert isinstance(data, (list, tuple)), "Data must be list of NDArrays" AssertionError: Data must be list of NDArrays

Heidisnaps avatar Sep 07 '17 01:09 Heidisnaps

@zhreshold

piiswrong avatar Sep 07 '17 03:09 piiswrong

@Heidisnaps Can you make sure you have demo images loaded correctly? I cannot reproduce the error.

zhreshold avatar Sep 07 '17 05:09 zhreshold

@Heidisnaps could you fix the issue? I have the same problem.

dlahmad avatar Sep 24 '17 16:09 dlahmad

@apache/mxnet-committers: This issue has been inactive for the past 90 days. It has no label and needs triage.

For general "how-to" questions, our user forum (and Chinese version) is a good place to get help.

szha avatar Dec 25 '17 00:12 szha

I do not remember it for a long time, but the problem may be solved. Using the mxnet in zhreshold instead of the official mxnet in the build. When asked, there was not enough explanation for beginners to follow, so it was difficult to build mxnet.

Heidisnaps avatar Dec 26 '17 01:12 Heidisnaps

Here is the way to reproduce the problem. Probably I misunderstand the meaning of list of NDArrays. Any suggestion? thx.

import mxnet as mx import numpy as np data = np.zeros([16,3,32,32]) data.shape (16, 3, 32, 32) label= np.zeros([16]) d = mx.io.DataBatch(data, label=label) Traceback (most recent call last): File "", line 1, in File "/home/ubuntu/.local/lib/python2.7/site-packages/mxnet-1.0.0-py2.7.egg/mxnet/io.py", line 157, in init assert isinstance(data, (list, tuple)), "Data must be list of NDArrays" AssertionError: Data must be list of NDArrays

jiayiliu avatar Jan 11 '18 22:01 jiayiliu

Suggested Labels : "NDArrays", "Ubuntu", "Python"

harshitajain1994 avatar Mar 20 '18 21:03 harshitajain1994

Not seeing this issue with MXNet 1.2.0. Executed ~incubator-mxnet/example/ssd$ python demo.py --cpu --network resnet50 --data-shape 512 to test.

For the sample code,

import mxnet as mx
import numpy as np
data = np.zeros([16,3,32,32])
data.shape
(16, 3, 32, 32)
label= np.zeros([16])
d = mx.io.DataBatch(data, label=label)

d = mx.io.DataBatch([data], label=[label]) should fix the issue.

vandanavk avatar Jul 16 '18 18:07 vandanavk

@Heidisnaps do you still see this issue?

vandanavk avatar Jul 18 '18 18:07 vandanavk

@vandanavk sorry. I have not run this code recently, so I don't know.

Heidisnaps avatar Jul 19 '18 01:07 Heidisnaps

Since unable to reproduce, closing the issue. Please reopen if issue still persists.

sandeep-krishnamurthy avatar Jul 19 '18 05:07 sandeep-krishnamurthy