This fork enables tensorflow lite for microcontrollers with CMake. It can be used for easy integration of tflite-micro in existing CMake projects. The fork includes an option to build the project with the Raspberry PI Pico SDK.
The default build type is set to Release. Build the project with testing enabled :
git clone https://github.com/ericheim/tflite-micro.git
mkdir build
cd build
cmake ../tflite-micro -DTFLITE_BUILD_TESTING=ON
make -j 12
Run the tests:
ctest
The following paramters can be passed to the build:
-DCMAKE_BUILD_TYPE=[Release|Debug] # default: Release
-DTFLITE_BUILD_TESTING=[ON|OFF] # default: OFF
-DTFLITE_STRIP_ERROR_STRINGS=[ON|OFF] # default: ON
tflite-micro can be included into an existing CMake project by using add_subdirectory() in a similar way as it is done for Tensorflow lite:
set(TFMICRO_SOURCE_DIR "" CACHE PATH
"Directory that contains the TensorFlow project" )
if(NOT TFMICRO_SOURCE_DIR)
get_filename_component(TFMICRO_SOURCE_DIR
"${PROJECT_SOURCE_DIR}/../tflite-micro" ABSOLUTE)
endif()
add_subdirectory(
"${TFMICRO_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/tfmicro" EXCLUDE_FROM_ALL)
# Use it by linking tensorflow-lite micro
add_executable(minimal minimal.cc)
target_link_libraries(minimal tensorflow-micro)
Configure your project with the path to tflite-micro:
cmake ../<path_your_project> -DTFMICRO_SOURCE_DIR=<path_to_tflite_micro>
When you have the PICO_SDK_PATH set in your project, tflite-micro will use the Raspberry PI Pico as target platform. In that case platform specific headers from the PICO_SDK and the implementation of clock and logging in /tensorflow/lite/micro/rp2 will be used.
You can probably just add platform specific implementations like it is done for rp2.
- TensorFlow Lite for Microcontrollers
- Build Status
- Contributing
- Getting Help
- Additional Documentation
- RFCs
TensorFlow Lite for Microcontrollers is a port of TensorFlow Lite designed to run machine learning models on DSPs, microcontrollers and other devices with limited memory.
Additional Links:
Build Type | Status |
---|---|
CI (Linux) | |
Code Sync |
This table captures platforms that TFLM has been ported to. Please see New Platform Support for additional documentation.
Platform | Status |
---|---|
Arduino | |
Coral Dev Board Micro | TFLM + EdgeTPU Examples for Coral Dev Board Micro |
Espressif Systems Dev Boards | |
Renesas Boards | TFLM Examples for Renesas Boards |
Silicon Labs Dev Kits | TFLM Examples for Silicon Labs Dev Kits |
Sparkfun Edge | |
Texas Instruments Dev Boards |
This is a list of targets that have optimized kernel implementations and/or run the TFLM unit tests using software emulation or instruction set simulators.
Build Type | Status |
---|---|
Cortex-M | |
Hexagon | |
RISC-V | |
Xtensa | |
Generate Integration Test |
See our contribution documentation.
A Github issue should be the primary method of getting in touch with the TensorFlow Lite Micro (TFLM) team.
The following resources may also be useful:
-
SIG Micro email group and monthly meetings.
-
SIG Micro gitter chat room.
-
For questions that are not specific to TFLM, please consult the broader TensorFlow project, e.g.:
- Create a topic on the TensorFlow Discourse forum
- Send an email to the TensorFlow Lite mailing list
- Create a TensorFlow issue
- Create a Model Optimization Toolkit issue
- Continuous Integration
- Benchmarks
- Profiling
- Memory Management
- Logging
- Porting Reference Kernels from TfLite to TFLM
- Optimized Kernel Implementations
- New Platform Support
- Platform/IP support
- Software Emulation with Renode
- Software Emulation with QEMU
- Python Dev Guide
- Automatically Generated Files
- Python Interpreter Guide