Open hyabe opened 5 years ago
Thank you for report, and sorry for late reply.
I could get same error, and set opset_version=7
option on export source, resolve it with VGG example. Please add the option on export when use TVM runtime.
Yet ResNet50 got another error.
Traceback (most recent call last):
File "export.py", line 77, in <module>
main()
File "export.py", line 73, in main
save_as_onnx_then_import_from_nnvm(model, 'resnet50.onnx')
File "export.py", line 50, in save_as_onnx_then_import_from_nnvm
module.set_input(**params)
File "/root/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/contrib/graph_runtime.py", line 139, in set_input
self._get_input(k).copyfrom(params[k])
File "/root/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/_ffi/ndarray.py", line 212, in copyfrom
source_array.copyto(self)
File "/root/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/_ffi/ndarray.py", line 279, in copyto
self.handle, target.handle, None))
File "/root/.local/lib/python3.6/site-packages/tvm-0.5.dev0-py3.6-linux-x86_64.egg/tvm/_ffi/base.py", line 72, in check_call
raise TVMError(py_str(_LIB.TVMGetLastError()))
tvm._ffi.base.TVMError: [08:54:24] /usr/tvm/src/runtime/ndarray.cc:150: Check failed: from_size == to_size (4 vs. 8192) TVMArrayCopyFromTo: The size must exactly match
When I run NNVM example on TVM 0.5 (the latest release)/ChainerCV 0.12.0/Chainer 6.0.0rc1, it fails as follows:
There seems to be several complicated causes for this:
storage_order
attribute forMaxPool
operator, which was introduced in Opset 8 and unknown to NNVM.opset_version=1
foronnx_chainer.export()
can help the above, it makes arithmetic operators (e.g.Mul
) to be non-broadcasting mode. ONNX-Chainer generates broadcasting-Mul
for the last pooling of ResNet-50, which requires explicitbroadcast=1
in Opset 1.Mul
operator hasbroadcast=1
, NNVM raises another exception for tensor-by-scalar operation. (I'm asking at the TVM community for this problem)