2023 TensorflowLite Update?

Does anyone have an update on TensorflowLite for 2023?

The main github is https://github.com/tensorflow/tflite-micro which has made an Arduino version that does not seem to have any action on it for 6 months.

@ptillisch

I see several posts that touch on it

I have seen suggestions to load this zipped library

https://downloads.arduino.cc/libraries/github.com/bcmi-labs/Arduino_TensorFlowLite-2.4.0-ALPHA.zip

But the above is not using the new stykle of TensorflowLite so basically is a deprecated version. The new version is at

https://github.com/tensorflow/tflite-micro-arduino-examples

Which works awesome for the Nano33BleSense REV1 which you cant purchase anymore.

The new version has an interesting peripherals folder and peripherals.h file that should make using it with other boards very easy:

https://github.com/tensorflow/tflite-micro-arduino-examples/blob/main/src/peripherals/peripherals.h

but it isn't somehow they have forced the use of I2S for all boards.

It is very important to be able to use the latest version of the software. Is there anyone interested in trying to problem solve this?

I did it three years ago here, but that would be crazy to do any work on a three year old repository. I find it very worrisome to have to rely on cloud versions who don't necessarily want to make the changes you need done for your project.

Please heart this if you are interested. I mainly work with the PortentaH7 but recently am interested in the Nicla boards and of course the Nano33BleSense REV2 needs to be able to work.

@pert

Why do you think that? The world has moved on from the outdated and trivial Tensorflow examples.

More importantly, what do you really want to do?

I'm not knowledgeable enough on the subject to comment on the "outdated" and "trivial" claims, but something to note is that, despite the "examples" in the repository name, tensorflow/tflite-micro-arduino-examples is actually TensorFlow Lite packaged as an Arduino library (which includes demonstration example sketches as most Arduino libraries do).

Actually it is TensorFlow Lite for Microcontrollers, which is even more limited than TensorFlow Lite.

The fact that no one seems to be updating the libraries is an pretty good indication of how little interest there is in this extremely limited offering.

As far as I'm concerned, it is just a demo showing that some small NN models can run on a microprocessor. It is hard to imagine why anyone would want to explore a new project/application on such a limited system, when PC laptops and desktops are so powerful, cheap and available.

:rofl: @jremington This is an Arduino forum, putting machine learning on Arduinos is kind of the point of this thread. Yes ML works great on a laptop, using Python or even Javascript. I have a huge set of demo examples here that I made over several years that work in the browser or even on your cell phone.

But yes, there is a huge field called TinyML with many companies working on putting simple ML models on microcontrollers at a fraction of the cost, size and energy. It is expected to be a huge field as the classification is done on the device instead of having to load all the data onto the cloud. It is called edge computing, and yes a computer can do it, but they are large, power hungry and a bit more expensive than a microcontroller.

@ptillisch Yes, that library works great on the Nano33BleSense REV1 but porting it to other Arduinos has been problematic for me. If someone could figure out a few examples of how to use it with the Nano33BleSense REV2, PortentaH7 or a Nicla board that would be very useful. The problem for me is that the code expects I2S for sound data management even when the sketch does not use sound.

Many other companies are very interested in this field such as Seeedstudio's new $14 USD XIAO Esp32S with camera, SD card and microphone, or Googles $79 USD Coral-Micro with camera, microphone and TPU. I have many of these boards and they both work fine.

Of course Arduino can just fall behind, doesn't really bother me. I like teaching robotics using Arduinos and was just trying to help.

That has been done, many times. No one has any doubts that small NN models run on microprocessors.

The question is, what do you want to do?

Hi, if you are still interested in using the latest TensorFlow Lite for Microcontroller library, I wrote a guide and prepared a Colab notebook to generate the library compatible for almost all Arduino compatible platforms.

Everything is in the GitHub repository of the TinyML Cookbook, 2E (GitHub - PacktPublishing/TinyML-Cookbook_2E: TinyML Cookbook, 2E_Published by Packt)

In particular:
The guide: https://github.com/PacktPublishing/TinyML-Cookbook_2E/blob/main/Docs/build_arduino_tflitemicro_lib.md

The Colab notebook: https://github.com/PacktPublishing/TinyML-Cookbook_2E/blob/main/Docs/build_arduino_tflitemicro_lib.ipynb

A recent Arduino TensorFlow Lite for Microcontroller library: https://github.com/PacktPublishing/TinyML-Cookbook_2E/blob/main/ArduinoLibs/Arduino_TensorFlowLite.zip

Let me know if it works (or it does not) for you.

Best,
Gian Marco

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.