ONNX-MXNet API

Overview

ONNX is an open format to represent deep learning models. With ONNX as an intermediate representation, it is easier to move models between state-of-the-art tools and frameworks for training and inference.

The mxnet.contrib.onnx package refers to the APIs and interfaces that implement ONNX model format support for Apache MXNet.

With ONNX format support for MXNet, developers can build and train models with a variety of deep learning frameworks, and import these models into MXNet to run them for inference and training using MXNet’s highly optimized engine.

Warning

This package contains experimental APIs and may change in the near future.

Installation Instructions

  • To use this module developers need to install ONNX, which requires protobuf compiler to be installed separately. Please follow the instructions to install ONNX and its dependencies. Once installed, you can go through the tutorials on how to use this module.

This document describes all the ONNX-MXNet APIs.

mxnet.contrib.onnx.import_model Imports the ONNX model file, passed as a parameter, into MXNet symbol and parameters.

API Reference

Module for ONNX model format support for Apache MXNet.

mxnet.contrib.onnx.import_model(model_file)[source]

Imports the ONNX model file, passed as a parameter, into MXNet symbol and parameters. Operator support and coverage - https://cwiki.apache.org/confluence/display/MXNET/ONNX

Parameters:model_file (str) – ONNX model file name
Returns:
  • sym (Symbol) – MXNet symbol object
  • arg_params (dict of str to NDArray) – Dict of converted parameters stored in mxnet.ndarray.NDArray format
  • aux_params (dict of str to NDArray) – Dict of converted parameters stored in mxnet.ndarray.NDArray format