mirror of
https://github.com/vee1e/tflite-micro.git
synced 2026-09-01 09:51:22 +00:00
TFLM recommends the use of MicroPrintf for logging messages to the terminal. This PR adds that information to the existing documentation. BUG=http://b/245802069
1.7 KiB
1.7 KiB
Message Logging in TFLite Micro
TFLM currently support MicroPrintf to log errors or messages to the terminal. This is a light-weight printf-lite utility available to log messages to the terminal. The MicroPrintf calls are designed to be ignored or optimized-out by the compiler, during deployment, if TF_LITE_STRIP_ERROR_STRINGS environment flag is set. This is useful to reduce the binary size of the TFLM application.
To use MicroPrintf in your application code or kernel implementations:
Include this header file:
#include "tensorflow/lite/micro/micro_log.h"
Introduce this Bazel BUILD dependency:
"//tensorflow/lite/micro:micro_log",
Example usage:
size_t buffer_size = 1024;
...
MicroPrintf("Failed to allocate buffer of size- %d", buffer_size);
MicroPrintf("TFLM is the best! Bring ML to Embedded targets!");
Do Not Use:
TFLM does not support/recommend the use of TF_LITE_KERNEL_LOG and TF_LITE_REPORT_ERROR to log errors or messages to the terminal.