On-device inference with TFLu
Here we are, with our first ML application on microcontrollers.
In this recipe, we will finally discover how to use TensorFlow Lite for Microcontrollers (TFLu) to run the TFLite model on an Arduino Nano and a Raspberry Pi Pico.
The following Arduino sketch contains the code referred to in this recipe:
09_classification.ino
:
Getting ready
To get ready with this last recipe, we need to know how inference with TFLu works.
TFLu was introduced in Chapter 1, Getting Started with TinyML, and is the software component that runs TFLite models on microcontrollers.
Inference with TFLu typically consists of the following:
- Loading and parsing the model: TFLu parses the weights and network architecture stored in the C-byte array.
- Transforming the input data: The input data acquired from the sensor is converted to...