--- id: onnx2tf version: "2.6.8" license: MIT license_treatment: permissive maintenance: active --- # onnx2tf — A tool for converting ONNX files to LiteRT/TFLite/TensorFlow, PyTorch native code (nn.Module), TorchScript (.pt), state_dict (.pt), Exported Program (.pt2), and Dynamo ONNX. It also supports direct conversion from LiteRT to PyTorch. License: permissive · Maintenance: active · Downloads: 1.6M/mo ## What it is and what it does onnx2tf is a model format converter that takes ONNX (Open Neural Network Exchange) files and translates them into multiple target frameworks: LiteRT (Google's edge ML runtime), TensorFlow/TFLite, PyTorch (as native nn.Module code or TorchScript), and other formats. It also works in reverse, converting LiteRT models back to PyTorch. The package uses two execution paths: flatbuffer_direct (the current default, optimized for speed and success rate) and tf_converter (a legacy path supporting a large set of ONNX operators). The tool is designed for developers who need to move trained models between frameworks—for instance, to deploy a PyTorch model on mobile via TFLite, or to run a TensorFlow model in PyTorch training pipelines. The package depends on 18 runtime libraries covering ONNX tooling (onnx, onnxruntime, onnxsim, onnxoptimizer, onnxscript), ML frameworks (ai-edge-litert, flatbuffers), and utilities (numpy, opencv-python, protobuf, h5py). It requires Python 3.12 or later and is actively maintained. The conversion success depends on whether your model's layers are in the supported operator list; the documentation lists hundreds of ONNX operators with full or partial support status. Use it for: - Deploy a PyTorch model to mobile/edge devices by converting to LiteRT or TFLite format. - Migrate a trained TensorFlow model to PyTorch for retraining or fine-tuning in a different framework. - Convert ONNX models (from any framework) to TensorFlow for production serving. - Optimize and simplify ONNX graphs before deployment using the built-in simplification and optimization tools. - Export PyTorch models through ONNX as an intermediate step to reach non-PyTorch runtimes. - Validate model compatibility across frameworks by round-tripping through ONNX and LiteRT. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Converts ONNX model files to LiteRT, TensorFlow, PyTorch, TorchScript, and other formats, with support for direct conversion from LiteRT back to PyTorch. Yes, if you need to convert ONNX models to LiteRT, TensorFlow, or PyTorch. The package is actively maintained, has low install friction, and covers a broad set of ONNX operators. Check the supported operator list against your model's layers first—partial or missing support for specific ops may require workarounds. MIT license poses no restrictions. Not necessary if you work exclusively within one framework. ## Install pip install onnx2tf uv add onnx2tf poetry add onnx2tf ## Installing onnx2tf Before you install: Low install friction with a pure Python wheel. Active maintenance—last commit 2026-08-01, 13 days old. Requires Python 3.12 or later. Pulls in 18 runtime dependencies including numpy, onnx, onnxruntime, and TensorFlow-adjacent libraries (ai-edge-litert, flatbuffers); dependency chain is substantial but standard for ML tooling. License in practice: MIT license (permissive). No restrictions on commercial or proprietary use; you may use, modify, and distribute this package with minimal obligations. Quickstart: pip install onnx2tf from onnx2tf import onnx2tf # Convert ONNX to LiteRT (default backend) onnx2tf.convert(onnx_model_path='model.onnx', output_dir='./output') Requires Python 3.12 or later. Conversion success depends on whether your ONNX model's layers are supported by the target backend (tf_converter or flatbuffer_direct). Verify before relying: - Exact list of PyTorch export formats (nn.Module, TorchScript, state_dict, Exported Program, Dynamo ONNX) and their completeness/stability. - Performance characteristics and conversion time for typical model sizes. - Handling of unsupported ONNX operators and error recovery behavior. - Whether flatbuffer_direct backend covers all use cases or if tf_converter fallback is still needed. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags onnx to tensorflow conversion, onnx to litert converter, onnx to pytorch export, model format conversion tool, onnx to tflite converter, deep learning model conversion, neural network format translator, model-conversion, ml-deployment, edge-inference [View on SkillFed](https://skillfed.io/packages/onnx2tf) · [View on PyPI](https://pypi.org/project/onnx2tf/)