AN 1011: TinyML Applications in Altera FPGAs Using LiteRT for Microcontrollers
ID
848984
Date
4/07/2025
Public
Visible to Intel only — GUID: xfk1740470307370
Ixiasoft
2.5.1. Converting LiteRT to a C Array
In a microcontroller environment, the LiteRT model is included as a C array and compiled into the C application. Use the following Python script to convert the LiteRT model into a C array:
! xxd -i lenet.tflite > model_data.cc
Content of model_data.cc
unsigned char lenet_tflite[] = {…}; unsigned int lenet_tflite_len = 660296;
Apply the follow changes to improve the processor execution:
#include "model_data.h" alignas(8) const unsigned char lenet_tflite[] = {…}; const unsigned int lenet_tflite_len = 660296;