Arduino_TensorFlowLite library has been declared as precompiled:
The precompiled library could not be found in "c:UserszbcDocumentsArduinolibrariesArduino_TensorFlowLitesrccortex-m4fpv4-sp-d16-softfp".
The precompiled library could not be found in "c:UserszbcDocumentsArduinolibrariesArduino_TensorFlowLitesrccortex-m4".
Can someone tell me how to fix this, could it be that the versions are incompatible? Is there a way to download the various versions of the arduino TensorFlow lite library, I would be very grateful!
I moved your topic to an appropriate forum category @jiangxipeng.
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
Hi @jiangxipeng. These are only helpful messages that tell you that the library author configured the library metadata to use precompiled binaries of the library but suitable binaries were not found for the board you are compiling for.
The reason that precompiled binaries are provided with some of the distributions of the "Arduino_TensorFlowLite" library is that this is a very complex library with a lot of code, which means it takes a significant amount of time to compile it. So by providing precompiled binaries, the library becomes more convenient to use.
Arduino IDE is smart enough to simply compile the library from the source code when it doesn't find the suitable precompiled binaries. So the lack of such binaries doesn't cause any problem other than that the first compilation of the library takes some time. Arduino IDE automatically caches the compiled library, so after that first compilation the subsequent compilations of sketches that use the library will be just as fast as they would have been if the precompiled binaries had been available.
So please simply ignore these messages and carry on with your project.
Is there some reason, other than the innocuous "The precompiled library could not be found" messages, that you think some version other than the one you have installed already is needed?
The error is as follows:C:\Users\zbc\AppData\Local\Temp\arduino\sketches\887E98193B012A7B029512B88A3A9E4C\libraries\Arduino_TensorFlowLite\tensorflow\lite\micro\objs.a(micro_error_reporter.cpp.o): In function tflite::MicroErrorReporter::Report(char const*, std::__va_list)': c:\Users\zbc\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/micro_error_reporter.cpp:35: undefined reference to DebugLog'
c:\Users\zbc\Documents\Arduino\libraries\Arduino_TensorFlowLite\src/tensorflow/lite/micro/micro_error_reporter.cpp:36: undefined reference to `DebugLog'
Unfortunately the situation with the TensorFlow Lite Micro Arduino libraries is a bit messy and confusing. Arduino maintained a library named "Arduino_TensorFlowLite" for years, but then the TensorFlow developers contacted us and requested we remove that library because they were maintaining their own Arduino library:
Confusingly, the TensorFlow Lite developers chose the same "Arduino_TensorFlowLite" name for their library so it is difficult for me to understand whether you have found a copy of the version of the library distributed by Arduino, or if you are using the library maintained by the TensorFlow organization.
In addition, there are several other 3rd party TensorFlow Lite Micro Arduino libraries available.
Again, it depends on which library you are using. There have been breaking changes in the library that cause code written for one version of the library to fail to compile for another version. The fact that the TensorFlow developers never bothered to version their library makes it difficult to understand which version should be used with any code you find on the Internet. In addition, there are some bugs in the library and the TensorFlow developers abandoned the project soon after taking it over from Arduino so those bugs will never be fixed in the "Arduino_TensorFlowLite" library.
I'm not very knowledgeable on the subject, but if you are looking for a source of an Arduino library based on the recent version of TensorFlow Lite Micro, this looks promising:
If you are starting a project from scratch, I think it would be better to use that the seriously outdated library that was distributed by Arduino or the unfinished and abandoned library created by the TensorFlow developers.
The Google team does not maintain any porting projects for specific microcontrollers, so the Arduino_TensorFlowLite project was abandoned in 2022 and the repository is no longer synchronized.
For this reason, we decided to create a new project by developing the new Chirale_TensorFlowLite library, which is available in the library manager of the IDE.
The library has the same style and structure as the old Arduino_TensorFlowLite.
Additionally, since the API style is not the conventional one used in Arduino sketches, we have defined an additional wrapper library, also available in the IDE registry, called ArduTFLite.
The latter simplifies the use of TensorFlow Micro through APIs that do not use pointers or other C++ syntactic constructs unusual in Arduino.
We successfully tested the examples included in both libraries on the boards Arduino Nano 33 BLE, Arduino Nano ESP32, Arduino Guiga R1 WiFi, Arduino Nicla and Arduino Portenta.
We hope that these updated libraries will be useful to anyone looking to start a project based on TensorFlow Lite on the new Arduino boards.