[SOLVED] Nnvm quick start error

HI there,

I build the tvm with llvm on windows.

When I run the nnvm quick start script, I got the following error:
Traceback (most recent call last):
File “.\nnvm_quick_start.py”, line 85, in
net, target, shape={“data”: data_shape}, params=params)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 287, in build
graph, params = precompute_prune(graph, params)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 406, in precompute_prune
out_arrs = _run_graph(pre_graph, params)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 355, in _run_graph
graph, libmod, _ = build(graph, target, shape, dtype)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 254, in build
raise TypeError(“shape value must be int iterator”)
TypeError: shape value must be int iterator

Anyone can help?

Did you modify the script cause it’d be line 83 in the latest version?

Same problem.

I built the latest tvm, and download the nnvm_quick_start.py from tvm doc website.
Error are similar as below:

Traceback (most recent call last):
File “.\nnvm_quick_start.py”, line 83, in
net, target, shape={“data”: data_shape}, params=params)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 288, in build
graph, params = precompute_prune(graph, params)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 407, in precompute_prune
out_arrs = _run_graph(pre_graph, params)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 356, in _run_graph
graph, libmod, _ = build(graph, target, shape, dtype)
File “C:\Users\user\AppData\Roaming\Python\Python27\site-packages\nnvm-0.8.0-py2.7.egg\nnvm\compiler\build_module.py”, line 255, in build
raise TypeError(“shape value must be int iterator”)
TypeError: shape value must be int iterator

Sorry, I don’t have Windows dev environment. Could you try to print out the type of elements in data_shape before line 83?

Thanks for reply.

The data_shape is a tuple.

And I iterate it and print the element’s type using the following code. It’s all int.

for dd in data_shape:
print(type(dd))

output:
<type ‘int’>
<type ‘int’>
<type ‘int’>
<type ‘int’>

After I dig in the python code, I found out numpy’s shape type in windows is different from Linux.

Please refer to the following link for more info.

In Linux: Shape type will be int.
In Windows: Shape type will be long.

I modify the source code and successfully run the code.

FYI

Thanks for the update