tensorflow/lite/core/api/error_reporter.h
says:
If you are looking to reduce binary size, define TF_LITE_STRIP_ERROR_STRINGS
cmake -DCMAKE_BUILD_TYPE=Release -DTF_LITE_STRIP_ERROR_STRINGS=ON -DTFLITE_ENABLE_XNNPACK=ON ../tensorflow_src/tensorflow/lite/
however outputs:
CMake Warning:
Manually-specified variables were not used by the project:
TF_LITE_STRIP_ERROR_STRINGS
And when I continue building TfLite, then indeed I still see a TfLite ERROR message when I load a (deliberately) broken TfLite model.
Putting #define TF_LITE_STRIP_ERROR_STRINGS 1
at the top of my own code also does not get rid of the TfLite ERROR message.
Example code:
#define TF_LITE_STRIP_ERROR_STRINGS 1
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/core/api/error_reporter.h"
int main() {
const char invalid_model[] = {1, 2, 3};
unique_ptr<tflite::FlatBufferModel> m = tflite::FlatBufferModel::VerifyAndBuildFromBuffer(invalid_model, 3);
return 0;
}