ONNX Tutorials

July 15, 2024 ยท View on GitHub

Open Neural Network Exchange (ONNX) is an open standard format for representing machine learning models. ONNX is supported by a community of partners who have implemented it in many frameworks and tools.

Getting ONNX models

  • Pre-trained models (validated): Many pre-trained ONNX models are provided for common scenarios in the ONNX Model Zoo
  • Pre-trained models (non-validated): Many pre-trained ONNX models are provided for common scenarios in the ONNX Model Zoo.
  • Services: Customized ONNX models are generated for your data by cloud based services (see below)
  • Convert models from various frameworks (see below)

Services

Below is a list of services that can output ONNX models customized for your data.

Converting to ONNX format

Framework / ToolInstallationTutorial
Caffeapple/coremltools and onnx/onnxmltoolsExample
Caffe2part of caffe2 packageExample
Chainerchainer/onnx-chainerExample
Cognitive Toolkit (CNTK)built-inExample
CoreML (Apple)onnx/onnxmltoolsExample
Kerasonnx/tensorflow-onnxExample
LibSVMonnx/onnxmltoolsExample
LightGBMonnx/onnxmltoolsExample
MATLABDeep Learning ToolboxExample
ML.NETbuilt-inExample
MXNet (Apache)part of mxnet package docs githubExample
PyTorchpart of pytorch packageExample1, Example2, export for Windows ML, Extending support
SciKit-Learnonnx/sklearn-onnxExample
SINGA (Apache) - Github (experimental)built-inExample
TensorFlowonnx/tensorflow-onnxExamples

Scoring ONNX Models

Once you have an ONNX model, it can be scored with a variety of tools.

Framework / ToolInstallationTutorial
Caffe2Caffe2Example
Cognitive Toolkit (CNTK)built-inExample
CoreML (Apple)onnx/onnx-coremlExample
MATLABDeep Learning Toolbox ConverterDocumentation and Examples
MenohGithub Packages or from NugetExample
ML.NETMicrosoft.ML Nuget PackageExample
MXNet (Apache) - GithubMXNetAPI
Example
ONNX RuntimeSee onnxruntime.aiDocumentation
SINGA (Apache) - Github [experimental]built-inExample
Tensorflowonnx-tensorflowExample
TensorRTonnx-tensorrtExample
Windows MLPre-installed on Windows 10API
Tutorials - C++ Desktop App, C# UWP App
Examples
Vespa.aiVespa Getting Started GuideReal Time ONNX Inference
Distributed Real Time ONNX Inference for Search and Passage Ranking

End-to-End Tutorials

Tutorials demonstrating how to use ONNX in practice for varied scenarios across frameworks, platforms, and device types

General

Mobile

ONNX Quantization

ONNX as an intermediary format

ONNX Custom Operators

Visualizing ONNX Models

Other ONNX tools

Application of ONNX

Contributing

We welcome improvements to the convertor tools and contributions of new ONNX bindings. Check out contributor guide to get started.

Use ONNX for something cool? Send the tutorial to this repo by submitting a PR.