ONNX to Keras and ONNX to TFLite tools
onnx2tflite converts an ONNX model to Keras or TensorFlow Lite, automatically aligning PyTorch's channel order to TensorFlow's, and supports FP16 and INT8 quantization for deployment.
onnx2tflite converts a model exported from ONNX into a Keras model or a TensorFlow Lite file, automatically converting PyTorch's NCHW channel layout to TensorFlow's NHWC layout. The project reports output within about 1e-5 average error per element compared to the original ONNX model, and TensorFlow Lite output around 30 percent faster than the existing onnx_tf converter.
It supports FP16 and INT8 quantization, including full-integer quantization, with INT8 calibration data supplied as one NumPy file per model input; it offers two conversion backends, a stable Keras-based path and a faster direct-IR path that builds a TensorFlow Lite FlatBuffer straight from the ONNX graph and bypasses Keras, falling back to the Keras path for operators the direct path does not yet support, such as Erf.
It is installed from source with setup.py and used from Python or a command-line interface.