8000 GitHub - ericheim/tflite-micro: Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).

License

Notifications You must be signed in to change notification settings

ericheim/tflite-micro

 
 

Repository files navigation

CMake build for tflite-micro

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.

Build and Test tflite-micro standalone project

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

How to add tflite-micro to your project

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>

Enable build for Rapsberry PI Pico

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.

Build for different Microcontroller

You can probably just add platform specific implementations like it is done for rp2.

TensorFlow Lite for Microcontrollers

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 Status

Official Builds

Build Type Status
CI (Linux) CI
Code Sync Sync from Upstream TF

Community Supported TFLM Examples

This table captures platforms that TFLM has been ported to. Please see New Platform Support for additional documentation.

Platform Status
Arduino Arduino Antmicro
Coral Dev Board Micro TFLM + EdgeTPU Examples for Coral Dev Board Micro
Espressif Systems Dev Boards ESP Dev Boards
Renesas Boards TFLM Examples for Renesas Boards
Silicon Labs Dev Kits TFLM Examples for Silicon Labs Dev Kits
Sparkfun Edge Sparkfun Edge
Texas Instruments Dev Boards Texas Instruments Dev Boards

Community Supported Kernels and Unit Tests

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 Cortex-M
Hexagon Hexagon
RISC-V RISC-V
Xtensa Xtensa
Generate Integration Test Generate Integration Test

Contributing

See our contribution documentation.

Getting Help

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:

  1. SIG Micro email group and monthly meetings.

  2. SIG Micro gitter chat room.

  3. For questions that are not specific to TFLM, please consult the broader TensorFlow project, e.g.:

Additional Documentation

RFCs

  1. Pre-allocated tensors
  2. TensorFlow Lite for Microcontrollers Port of 16x8 Quantized Operators

About

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 74.1%
  • Python 13.4%
  • Starlark 4.2%
  • C 3.5%
  • Shell 1.9%
  • Makefile 1.4%
  • Other 1.5%
0