NVIDIA/mxnet_to_onnx

Name: mxnet_to_onnx

Owner: NVIDIA Corporation

Description: MxNet to ONNX Exporter

Created: 2018-01-11 20:50:29.0

Updated: 2018-03-03 08:59:29.0

Pushed: 2018-01-28 01:18:16.0

Homepage: null

Size: 17

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

MxNet-to-ONNX exporter

What is this?

This is the repository for the MxNet-to-ONNX converter, which takes a trained MxNet model, represented in serialized form as the .json/.params file pair, and converts that model to ONNX. Please note that this is a file-to-file conversion - the input is a checkpointed MxNet model, NOT the NNVM graph.

Installation

Note that –force will force an upgrade if a previous version was installed. This is equivalent to first uninstalling and then installing again. Without force, an upgrade will not be performed.

 note that since this project depends on ONNX, and ONNX depends on the [Protobuf](https://github.com/google/protobuf) compiler, the installation of the ONNX [pip](https://packaging.python.org/tutorials/installing-packages/#use-pip-for-installing) package will require the compiler. The installation of the native component will depend on your operating system, but on Ubuntu 16.04, you can simply do

See the details as to what is required to install ONNX. Note that even though the ONNX pip package can be fetched from PyPI, it will still depend on the Protobuf compiler. Hence, even though ONNX is listed in requirements.txt, its installation will depend on the aforementioned native components.

Tests

To run the test that:

  1. trains LeNet-5 on MNIST
  2. checkpoints the MxNet a trained model to the .json/.params file pair that represents a serialized MxNet model
  3. loads the serialized MxNet model and runs inference on test data
  4. converts the serialized MxNet model to ONNX
  5. loads the ONNX model and runs inference on test data
  6. asserts that all 10,000 predictions match

please run:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.