Giter Site home page Giter Site logo

mxnet_to_onnx's Introduction

MxNet-to-ONNX exporter

NOTE: This repository is deprecated, since MXNet now (since v. 1.3) has an officially integrated exporter, in part based on this repository. For the latest version of the exporter, please install the latest version of MXNet. The official exporter can now be found here.

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.

python setup.py install --force

Also note that since this project depends on ONNX, and ONNX depends on the Protobuf compiler, the installation of the ONNX pip 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

sudo apt-get install protobuf-compiler libprotoc-dev

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:

python setup.py test

mxnet_to_onnx's People

Contributors

mkolod avatar kellensunderland avatar andreh7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.