Compiling ONNX model, No Op registered for Plugin

Hi, I’m new to learning about TVM. I’m attempting to compile the model [CenterTrack] for faster inference. This model uses the 3rd party layer type DCNv2 (github: CharlesShang/DCNv2).

I’ve managed to convert this model to ONNX format. And now I’m trying to follow this ONNX to TVM tutorial: https://tvm.apache.org/docs/tutorials/frontend/from_onnx.html#sphx-glr-tutorials-frontend-from-onnx-py

At the step mod, params = relay.frontend.from_onnx(onnx_model, shape_dict) I get the following error:

>>> mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
/usr/tvm/python/tvm/relay/frontend/onnx.py:1314: UserWarning: No Op registered for Plugin with domain_version of 9

==> Context: Bad node spec: input: "549" input: "550" input: "dla_up.ida_0.proj_1.conv.weight" input: "dla_up.ida_0.proj_1.conv.bias" output: "551" op_type: "Plugin" attribute { name: "info" s: "{\"dilation\": [1, 1], \"padding\": [1, 1], \"stride\": [1, 1], \"deformable_groups\": 1}" type: STRING } attribute { name: "name" s: "DCNv2" type: STRING }
  warnings.warn(str(e))
Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/tvm/python/tvm/relay/frontend/onnx.py", line 1323, in from_onnx
    mod, params = g.from_onnx(graph, opset)

  File "/usr/tvm/python/tvm/relay/frontend/onnx.py", line 1102, in from_onnx
    raise ValueError("Must provide an input shape for `{0}`.".format(i_name))

ValueError: Must provide an input shape for `input.1`.

Could anyone please suggest how I proceed? I think this means I need to add support for DCNv2, but I’m not sure whether this should be added to ONNX or to TVM, and what the procedure is for this. Any help is greatly appreciated!

Also I’m using a TVM docker image, and while I was able to import tvm and relay, attempting to import tvm.te failed. It doesn’t look like the tutorial uses this, so I’m not sure if this is an issue or not.

1 Like

Were you able to resolve this? I am also facing this same error, but with a different network.

Hi, I think you can use onnx-simplifier: https://github.com/daquexian/onnx-simplifier to add dimension inference or fix dynamic shape with a command similar to:

python -m onnxsim yolov4.onnx opt-yolov4.onnx   --input-shape input_1:0:1,416,416,3

where input_1:0 is the name of the first imput.

I’m also new to tvm.