IREE supports compiling and running TensorFlow Lite programs stored as TFLite flatbuffers. These files can be imported into an IREE-compatible format then compiled to a series of backends.
Install TensorFlow-Lite specific dependencies using pip:
python -m pip install \ iree-compiler \ iree-runtime \ iree-tools-tflite
Failures during the import step usually indicate a failure to lower from TensorFlow Lite‘s operations to TOSA, the intermediate representation used by IREE. Many TensorFlow Lite operations are not fully supported, particularly those than use dynamic shapes. File an issue to IREE’s TFLite model support project.
The tflitehub folder in the iree-samples repository contains test scripts to compile, run, and compare various TensorFlow Lite models sourced from TensorFlow Hub.
An example smoke test of the TensorFlow Lite C API is available here.
| Colab notebooks | |
|---|---|
| Text classification with TFLite and IREE |
!!! todo
[Issue#3954](https://github.com/google/iree/issues/3954): Add documentation for an Android demo using the [Java TFLite bindings](https://github.com/google/iree/tree/main/bindings/tflite/java), once it is complete at [not-jenni/iree-android-tflite-demo](https://github.com/not-jenni/iree-android-tflite-demo).