Error message: Check failed: dshape.ndim() != 0 (0 vs. 0)


I’m following the android deploy tutorial in TVM. I was able to run the application on smartphone using default libraries that get downloaded as part of compilation.
My next step is to compile the libraries for ARM architecture. When I try to generate the libraries using
I’m observing the following error :

Build Graph…
[14:20:53] /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/src/compiler/ Check failed: dshape.ndim() != 0 (0 vs. 0) :
Stack trace:
[bt] (0) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/build/ [0x7fad329d2f83]
[bt] (1) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/ const&, nnvm::NodeEntry, nnvm::NodeEntry, nnvm::NodeEntry, nnvm::NodeEntry, nnvm::NodeEntry, nnvm::TShape, nnvm::TShape)+0xf4) [0x7fad1f57df04]
[bt] (2) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7fad1f582fd7]
[bt] (3) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7fad1f581bfc]
[bt] (4) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/ std::__1::__invoke_void_return_wrapper < nnvm::Graph>::__call<nnvm::Graph (&)(nnvm::Graph), nnvm::Graph>(nnvm::Graph (&&&)(nnvm::Graph), nnvm::Graph&&)+0xb6) [0x7fad1f552eb6]
[bt] (5) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/<nnvm::Graph ()(nnvm::Graph), std::__1::allocator<nnvm::Graph ()(nnvm::Graph)>, nnvm::Graph (nnvm::Graph)>::operator()(nnvm::Graph&&)+0xd) [0x7fad1f552dbd]
[bt] (6) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > > const&)+0x4c2) [0x7fad1f58d842]
[bt] (7) /local/mnt/workspace/abhikran/tvm/tvm_hexagon_2_August/tvm/nnvm/python/nnvm/…/…/…/build/ [0x7fad1f5213a8]
[bt] (8) /local/mnt/workspace/abhikran/software/setup/python3/Python-3.5.7/install_dir/lib/python3.5/lib-dynload/ [0x7fad3acddc6a]


I checked some topics and found a similar problem faced in this discussion: Run multiple keras models in one program

I tried the solution that worked in the above mentioned discussion i.e. replacing “input_0” in the script with “onnx_graph.graph.input[0].name” but still the error persists.

Request you to please help.


Hi @FrozenGene : Could you please help with the problem I’m seeing ?


Could you make sure your model’s tensor name and shape? If you pass wrong input information, which usually results in this error.


I am using “onnx_graph.graph.input[0].name” to get the name of first layer and the shape is already available in the example script.

org_img =’./data/test.jpg’)
org_img = org_img.resize((n, n))
img = np.asarray(org_img).astype(np.float32).copy()
img = img.transpose(2,0,1)
img /= 255.
img = img[np.newaxis,:]

input_name = ‘onnx_graph.graph.input[0].name’
data_shape = img.shape
out_shape = (1,125,n//32,n//32)

Still the error is observed. Do you suspect anything wrong here ?

Also, while debugging, I saw the problem to occur with “SimplifyInference” Pass. Any help would be appreciated.


‘onnx_graph.graph.input[0].name’ is a string. Meanwhile, the model has only one input? Could you share the model, maybe we can get more information.


I’m using this script :

In line 19, the model gets loaded.

Model used :


The input model name is so strange. Try to set the input name be this strange number.


Thank you @FrozenGene. This solved the problem!