talira

ONNX (Python package)

The ONNX project's Python package for building, loading, checking and converting ONNX models

open sourceApache-2.0free

onnx is the ONNX project's Python package for working with models in the ONNX format, the open interchange format for deep learning and traditional ML models. It loads and saves models (including models with external data), builds graphs with helper functions, converts between tensors and NumPy arrays, checks that a model is valid, infers shapes and types, and converts a model between opset versions. Runtimes such as ONNX Runtime then run the models it produces.

Problems it solves

  • check that the model file I exported is a valid ONNX model before shipping it
  • convert an ONNX model to a newer opset so another runtime accepts it
  • build or edit an ONNX graph from Python

Features

  • load and save ONNX models, including models with external data
  • build models with helper functions and convert tensors to and from NumPy arrays
  • model checker, shape and type inference, and opset version conversion