I wish to compile my ONNX model to TVM with NNVM and save it to file. However, I am experiencing difficulty on the last line in:
onnx_model = onnx.load(onnx_model_path)
target = tvm.target.create('llvm')
input_dict = { input_name: (1, 48) }
mod, params = nnvm.frontend.from_onnx(onnx_model)
with nnvm.compiler.build_config(opt_level=3):
graph, lib, params = nnvm.compiler.build(
mod, target, input_dict, params=params)
I get the following error:
nnvm._base.NNVMError: Error in operator elemwise_add0: [23:01:54] /usr/tvm/nnvm/src/top/tensor/../elemwise_op_common.h:57: Check failed: assign(&dattr, (*vec)[i]): Incompatible attr in node elemwise_add0 at 1-th input: expected [1,1], got [1]
When I was debugging, it seems that it does not like that shape
is
{'0.weight': (1, 48), '0.bias': (1,), 'input': (1, 48)}
. It seems to keep running if I set '0.bias': (1,1)
. However, how should I do this from the get-go?
I seem to have the same error as https://github.com/dmlc/tvm/issues/2599, but I do not know how to fix this for me personally.
Thank you.