View Source AxonOnnx (AxonOnnx v0.1.0)

Library for converting to and from Axon/ONNX.

ONNX is a Neural Network specification supported by most popular deep learning frameworks such as PyTorch and TensorFlow. AxonOnnx allows you to convert to and from ONNX models via a simple import/export API.

You can import supported ONNX models using AxonOnnx.import/2:

{model, params} = AxonOnnx.import("model.onnx")

model will be an Axon struct and params will be a compatible model state.

You can export supported models using AxonOnnx.export/3:

AxonOnnx.export(model, params)

Link to this section Summary

Functions

Exports an Axon model and parameters to an ONNX model.

Imports an ONNX model from the given path.

Link to this section Functions

Link to this function

export(model, params, opts \\ [])

View Source

Exports an Axon model and parameters to an ONNX model.

You may optionally specify a path to export a model to a specific file path:

AxonOnnx.export(model, params, path: "resnet.onnx")
Link to this function

import(path, dimensions \\ [])

View Source

Imports an ONNX model from the given path.

Some models support ONNX dim_params which you may specify by providing dimension names as a keyword list:

AxonOnnx.import("model.onnx", batch: 1)

The imported model will be in the form:

{model, params} = AxonOnnx.import("model.onnx")