How to load ONNX model using mxnet C++?


#1

Hello,

I want to load an ONNX exported model into mxnet and do inference, similar to the use case here : https://mxnet.apache.org/tutorials/onnx/super_resolution.html?highlight=onnx

Can someone point me how can I do that in mxnet C++ ?


#2

Hi @paduraru2009,

Currently there is no way to directly import an ONNX model into MXNet using the C++ API. But it is possible to load the model using the Python API, export the symbols and parameters and load back in with the C++ API.

Use the tutorial you linked to for steps on how to load into a Module using Python API. After this call save_checkpoint on the module, which will save the symbol and parameters to disk in the correct format. And then you can load this model with C++ API.