skillfed

tf2onnx

Tensorflow to ONNX converter

tf2onnx v1.17.0 395.3K downloads/30d#6,981 on PyPI2,551
Permissive license Apache-2.0 Active released

What it is and what it does

tf2onnx is a model converter that takes trained TensorFlow models in various formats (saved_model, checkpoint, graphdef, tflite, tensorflow.js) and translates them into ONNX format. This enables models trained in TensorFlow to run on any ONNX-compatible runtime, improving portability and deployment flexibility. The package works via a command-line interface or Python API, with support for opset versions 14-18 (default 15). It requires TensorFlow 2.13 or later and Python 3.10-3.12.

The converter handles the fundamental challenge that TensorFlow has more operations than ONNX, so not all models convert cleanly. The project documents supported operations and provides troubleshooting guidance. TensorFlow.js support is experimental. The package is actively maintained but currently seeking a new maintainer, which is worth noting when evaluating long-term reliability.

Use it for:

  • Deploy TensorFlow models on inference engines that don't natively support TensorFlow format
  • Convert Keras models to ONNX for cross-platform inference on mobile, edge, or cloud deployments
  • Migrate TFLite models to ONNX when targeting different hardware accelerators or inference frameworks
  • Enable model interoperability in ML pipelines that mix models from different training frameworks
  • Export trained models for production serving on systems where TensorFlow runtime is unavailable

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts TensorFlow, Keras, TensorFlow.js, and TFLite models to ONNX format via command line or Python API, enabling model portability across different inference runtimes.

Yes, if you need to convert TensorFlow models to ONNX. The package is production-stable, actively maintained, has no known security issues, and installs with low friction. The main caveat is that not all TensorFlow operations map cleanly to ONNX, so conversion success depends on your specific model architecture. The active search for a new maintainer is a yellow flag for long-term support, but current maintenance is solid.

Install

tf2onnx on PyPI

pip

pip install tf2onnx

uv

uv add tf2onnx

poetry

poetry add tf2onnx

Installing tf2onnx

Before you install

Low friction install with stable maintenance. The package is actively maintained, has no known vulnerabilities, and depends on standard libraries (numpy, onnx, protobuf, flatbuffers, requests). However, the project is actively seeking a new maintainer, which may signal future maintenance uncertainty.

License in practice

Apache-2.0 is a permissive license allowing commercial use, modification, and distribution with minimal restrictions, making this package suitable for most production and research contexts.

Quickstart

pip install tf2onnx
python -m tf2onnx.convert --saved-model tensorflow-model-path --output model.onnx

Requires TensorFlow 2.13 or later and Python 3.10-3.12; TensorFlow must be installed separately before conversion.

Verify before relying

  • Extent of tensorflow.js model support coverage beyond the noted experimental status and tested tfhub models
  • Performance characteristics and conversion success rates for complex or custom TensorFlow operations
  • Compatibility guarantees with TensorFlow versions outside the tested 2.13-2.15 range

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — numpy, onnx, requests, flatbuffers, protobuf
Maintenance actively maintained — 163 days since the last release
Last repo commit
First released
Downloads 395,329/month — #6,981 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tf2onnx-1.17.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

tensorflow to onnx converterconvert keras models to onnxtflite model conversiontensorflow model exportonnx model conversion tool
model-conversiononnxtensorflow

More Software Development packages