FluxML/ONNX.jl

Name: ONNX.jl

Owner: Flux

Description: Read ONNX graphs in Julia

Created: 2018-02-09 13:53:32.0

Updated: 2018-05-23 15:18:28.0

Pushed: 2018-05-21 10:17:17.0

Homepage: null

Size: 71

Language: Julia

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ONNX

Build Status

Coverage Status

codecov.io

ONNX.jl : Read ONNX graphs and load these models in Julia. ONNX.jl provides an instance of transfer learning into Julia, by reading pretrained models from ONNX format to Flux.jl. This is done by generating the DataFlow graph from the model, and then reading it as Julia code.

Loading models

You need to have the model.onnx ( or in some cases model.pb ) file, which will be read. Several pretrained ONNX model files can also be downloaded from here. Now that we have the model.onnx file, we can read it into Flux as :

a> using Flux, ONNX                             # Import the required packages.
a> ONNX.load_model("model.onnx")                # If you are in some other directory, specify the entire path.
                                                # This creates two files: model.jl and weights.bson.
a> weights = ONNX.load_weights("weights.bson")  # Read the weights from the binary serialized file.
a> model = include("model.jl")                  # Loads the model from the model.jl file.

And model is the corresponding model in Flux!

This package is currently under development, don't tell us we didn't warn you!

Running the tests

It's always better to run the tests before moving on to importing a model. The operator tests ensure that all ops are working. Follow the given steps to run these tests:

Contributing and Help

Since this package is currently under development, feel free to open an issue if you find any error/bug.

For more discussion, you can get in touch with us on Julia Slack. We're pretty active on the #machine-learning channel.


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.