Repolode
onnx

onnx/onnx

Open standard file format and ecosystem for representing machine learning models so they can move between frameworks and runtimes.

Stars
21,607
Forks
4,060
Open issues
293
Last commit
4 hours ago

What is it?

ONNX (Open Neural Network Exchange) defines an open format for AI models, covering both deep learning and traditional machine learning. It specifies an extensible computation graph model, built-in operators, and standard data types, with a current focus on inference (scoring).

The goal is interoperability: a model trained in one framework can be exported to ONNX and run by other frameworks, tools, or hardware backends that support the format. The project provides a Python package for creating, loading, checking, and manipulating ONNX graphs, along with shape and type inference, opset version conversion, and a reference implementation for optional dependencies.

The repository hosts the specification, operator documentation, and the Python package, which is published on PyPI and built with abi3-compatible wheels for Python 3.12 and later.

Key features

  • 01Defines an extensible computation graph model with built-in operators and standard data types.
  • 02Provides a Python package for creating, loading, and checking ONNX models.
  • 03Includes shape and type inference and opset version conversion utilities.
  • 04Offers graph optimization through a companion optimizer project.
  • 05Installable from PyPI with abi3 wheels for Python 3.12 and later.

Use cases

  • Exporting a model trained in PyTorch or TensorFlow for deployment in another runtime.
  • Inspecting, validating, or editing the operator graph of an existing model file.
  • Converting a model between operator set versions for compatibility with a target runtime.
  • Building tooling that consumes a common model format across multiple frameworks.

Quick start

  1. 1

    Install the ONNX Python package from PyPI

    pip install onnx
  2. 2

    Optionally install the reference implementation dependencies

    pip install onnx[reference]

Things to know

  • Focused on inferencing (scoring) capabilities rather than training.

Topics

FAQ

What is onnx?
Open standard file format and ecosystem for representing machine learning models so they can move between frameworks and runtimes. ONNX (Open Neural Network Exchange) defines an open format for AI models, covering both deep learning and traditional machine learning. It specifies an extensible computation graph model, built-in operators, and standard data types, with a current focus on inference (scoring).
Is onnx free to use? What license does it have?
onnx is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is onnx still maintained?
Actively maintained. The last commit to onnx was on Oct 22, 2026.
What can I use onnx for?
Exporting a model trained in PyTorch or TensorFlow for deployment in another runtime. Inspecting, validating, or editing the operator graph of an existing model file. Converting a model between operator set versions for compatibility with a target runtime. Building tooling that consumes a common model format across multiple frameworks.
How do I install onnx?
Install the ONNX Python package from PyPI: pip install onnx Optionally install the reference implementation dependencies: pip install onnx[reference]
Where can I get onnx?
The source code and installation instructions are on GitHub: https://github.com/onnx/onnx

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects