OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Onnx2Tf

Onnx2Tf is a Python developer tool for converting ONNX model files to LiteRT/TFLite, TensorFlow, and multiple PyTorch representations, including native modules, TorchScript, state dictionaries, and Exported Programs. It also supports converting LiteRT models to PyTorch. The project provides a CLI and Docker-based setup, and its README documents operator coverage and an ONNX-to-TensorFlow accuracy-checking workflow.

Independent OpenViST project profile, based on linked sources.

Onnx2Tf — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Onnx2Tf when a model is available in ONNX or LiteRT and a documented output route matches the framework or runtime needed downstream. Check the operator support list and the environment requirements first; use the accuracy-checking workflow when investigating ONNX-to-TensorFlow output differences.

Who it is for

  • Machine-learning developers moving ONNX models into LiteRT/TFLite or TensorFlow workflows.
  • PyTorch developers who need model representations such as nn.Module, TorchScript, state dictionaries or Exported Programs.
  • Teams assessing operator coverage and diagnosing differences between ONNX and TensorFlow outputs during conversion.

Documented uses

  • Convert an ONNX model into LiteRT/TFLite for a mobile or edge inference workflow.
  • Export an ONNX model to TensorFlow formats or several PyTorch representations.
  • Convert a LiteRT model into a PyTorch representation.
  • Inspect operator support and compare ONNX and TensorFlow outputs to investigate conversion errors.
Before you choose

Requirements & limits

The repository is public and lists an MIT license.

  • Check the model's operators against the README's support list, which marks some operators as only partially supported.
  • For onnx2tf 2.0.0 and later, the README specifies Python 3.10 or newer and warns that TensorFlow 2.15.0 or earlier does not work properly.
  • TensorFlow-backed features, including the listed TensorFlow exports, are installed with the TensorFlow extra.
  • Accuracy checks can use substantial RAM; the README says checks are skipped when estimated needs exceed 80% of total system RAM.
  • The project README recommends LiteRT Torch rather than onnx2tf.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Convert an ONNX model with the Docker image

Run the documented Docker conversion and write the SavedModel output into a host-mounted work directory.

Before you start

  • Docker installed and usable on the host
  • An ONNX model in the current host directory
  • For the GHCR image, registry authentication with a personal access token; the README says Docker Hub pulls do not require authentication

Steps

  1. Run the documented Docker command with the current directory mounted at /work.

  2. Pass the model path under /work to onnx2tf using -i, and set the desired output directory with -o.

  3. Use the documented example pattern: the input is /work/densenet-12.onnx and the output directory is /work/saved_model.

Expected outcome

The README describes conversion inside Docker with the model output written to the host-mounted directory.

Guide limitations

  • This documented example produces a SavedModel directory; it does not document the conversion of every model or output format.
  • The README states that onnx2tf 2.0.0 and later require Python 3.10 or newer and do not work properly with TensorFlow 2.15.0 or earlier.
Source-based practical guide

Install onnx2tf in a Python 3.12 virtual environment

Set up the documented Python environment and install onnx2tf, with an optional TensorFlow feature extra.

Before you start

  • A host environment able to run the documented uv setup commands

Steps

  1. Install uv using the README's documented installer command.

  2. Install Python 3.12.12 with uv and create a Python 3.12.12 virtual environment.

  3. Activate the environment and install onnx2tf with uv pip.

  4. For TensorFlow-backed features, install the documented onnx2tf[tensorflow] extra instead.

Expected outcome

The virtual environment has onnx2tf installed; selecting the TensorFlow extra adds the documented TensorFlow-backed features.

Guide limitations

  • This is an installation recipe; it does not run a model conversion.
  • The README warns that onnx2tf 2.0.0 and later do not work properly with TensorFlow 2.15.0 or earlier.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
PINTO0309/onnx2tf · Official homepage title · retained in its source language