htshinichi / caffe-onnx

caffe model convert to onnx model
MIT License
175 stars 43 forks source link

TypeError: 'int' object is not iterable #12

Closed kobenein closed 4 years ago

kobenein commented 4 years ago

Traceback (most recent call last): File "convert2onnx.py", line 34, in main(args) File "convert2onnx.py", line 27, in main c2o = Caffe2Onnx(graph, params, onnx_name) File "/home/kobenein/Downloads/caffe-onnx/src/caffe2onnx.py", line 29, in init self.addOutputsTVIandValueInfo() File "/home/kobenein/Downloads/caffe-onnx/src/caffe2onnx.py", line 509, in addOutputsTVIandValueInfo hid_out_tvi = helper.make_tensor_value_info(innernode.outputs_name[k], TensorProto.FLOAT,innernode.outputs_shape[k]) File "/home/kobenein/.local/lib/python3.7/site-packages/onnx/helper.py", line 342, in make_tensor_value_info for i, d in enumerate(shape): TypeError: 'int' object is not iterable

ZQPei commented 4 years ago

Is your onnx version 1.4.0?

kobenein commented 4 years ago

Failed to install onnx 1.4.0, so I use 1.6.0

ZQPei commented 4 years ago

Downgrade your onnx to 1.4.0 by pip uninstall onnx && pip install onnx==1.4.0.