2

I created an object detection model in AWS SageMaker, based on SSD/ResNet50 and in MXNet. Now I would like to optimize it in TensorRT, for which I need to export to ONNX as a first step.

Looking for any recommendation on converting _contrib_MultiBoxPrior to a supported symbol didn't yield any result for me.

Basic code

input_shape = (1, 3, 512, 512)
converted_model_path = onnx_mxnet.export_model(sym_file, params_file, [input_shape], np.float32, onnx_file)

The exact error message is

"AttributeError: No conversion function registered for op type _contrib_MultiBoxPrior yet."

What is the recommended way to solve this error?

1 Answers1

1

The implementation of the MultiBoxPrior operator is dependent on ONNX supporting it. You can track the issue here: https://github.com/apache/incubator-mxnet/issues/15181

Alternatively you can try using mxnet-tensorrt. It uses the subgraph API which means that the symbol that can be executed in TensorRT are executed in the TensorRT runtime, and the ones that cannot are executed in the MXNet runtime.

https://mxnet.incubator.apache.org/versions/master/tutorials/tensorrt/inference_with_trt.html

Note that the current version of this tutorial is for the 1.3.0 version of MXNet I believe. An update is coming for the next release with a simpler API and better performance.

Thomas
  • 676
  • 3
  • 18