Become a leader in the IoT community!
New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!
You are in luck, we have an engineering session going on with this plus you have @undefined2001 and @wafa_ath who should be very proficient at this.
Nice, I’ll look forward to it then. I’m doing Harvard TinyML course on edX. It’s good but they’re providing libraries to do everything in their arduino kit. I already have an STM32 board with me so I want to do it myself
Hi @.araki_ , can you tell more about the project you are doing
I had the same goal man
Hi @wafa_ath I have a trained tflite model for keyword spotting. I want to run the inference on my STM32F407 board using tflite micro. I am just learning embedded programming so I am a bit stuck on how to even go about doing this. Most tutorials are outdated. And it is now using bazel build system, am I supposed to build it as a library and link it during my stm project compilation?
Ah, can you inlcude the lib and build it with your source? What tutorial are you using
So you already trained your model ?
yep, I have a model. I just want to know how to invoke it from an STM32 project. I’m using STM32CUBE IDE
I’m trying to follow one from digikey but it is outdated. It was written before tflite-micro repository got separated and the buidsystem seems to be changed too
have you looked at this guide https://ai.google.dev/edge/litert/microcontrollers/get_started
Also @.araki_ check this https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/docs/new_platform_support.md
https://ai.google.dev/edge/litert/microcontrollers/get_started#1_include_the_library_headers
I was about to follow this as well. This gives information about running it but only if you follow it’s own generated structure. I’ll look into it more. Thanks for the links
this should work as well.
So fter converting your model to tflite Micro, you also need to convert it to C array. you need to download the TensorFlow Lite Micro source code and integrate it into your STM32 project. see the tutorial @superbike_z sends that should work
yep, I seem to understand it but I just don’t know how to include the source for those header files.
https://ai.google.dev/edge/litert/microcontrollers/library#generate_projects_for_other_platforms
I think this should work but the problem is, there is no “generate_projects” rule in the Makefile
Yeah, just grab the tflite-micro source files (like the ones in micro/, schema/, and flatbuffers/include/) and drop them into your STM32 project. Make sure the include paths are set up right, and you’re good to go. Don’t worry about the generate_projects it’s not needed for STM32.
Ok, I think I got tflite micro integrated into my project. Now I have to actually write error free code. I can’t get the resolver working but that’s for tomorrow. I’m all out of brain juice for today 😅
I’m new to this so I really appreciate your time and help. Thanks a lot @wafa_ath @superbike_z
very welcome , anytime
can we see your code please?
Late reply, but I got it working using the generated file structed by the following command. It also gives example c file so I’m simply following that code.
I still have to copy paste additional folders (following the compile errors). But now I’m getting errors from the TFLite library code itself.
@undefined2001 is working on this now, perhaps have a call with him.
I almost succeeded just one more step left
I hope after that we can chill
which C++ standard are you using?
CONTRIBUTE TO THIS THREAD