Crossing framework lines
Sometimes your model needs to run outside TensorFlow — in ONNX Runtime for cross-platform deployment, or TensorRT for NVIDIA GPU optimization. The tf2onnx tool converts TF/Keras models to the ONNX interchange format.
ONNX (Open Neural Network Exchange) is a vendor-neutral model format. Models in ONNX run via ONNX Runtime, TensorRT, OpenVINO, CoreML conversion, and any inference engine that supports the spec.
TensorFlow Hub is a repository of pretrained reusable model components. Hub modules can be loaded as Keras layers via hub.KerasLayer — useful for quick transfer learning experiments.
tf2onnx maintainer notice (2025): the project is seeking a new maintainer. It supports TF 2.13–2.15 and continues to function, but complex models may hit unsupported ops. For critical production use, test ONNX conversion thoroughly and have TF Serving as a fallback.