Let's compile this #TensorFlow Lite app on #BL602
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/micro/examples/hello_world
How we load a #TensorFlow Lite Model ... Before running inferences
How we run inferences with a #TensorFlow Lite Model
Missing FlatBuffers when building TensorFlow Lite for #BL602 ... Let's fix this
Fixed the #BL602 Makefile to install FlatBuffers ... For compiling TensorFlow Lite
https://github.com/lupyuen/tflite-bl602/blob/main/bouffalo.mk#L16-L56
TensorFlow Lite app exports the functions "setup" and "loop" (So cute!) ... Let's add them to #BL602 Command-Line Interface
https://github.com/lupyuen/bl_iot_sdk/blob/tflite/customer_app/sdk_app_tflite/sdk_app_tflite/demo.c
Our #BL602 TensorFlow Build has lotsa missing functions ... Let's fix the build
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
TensorFlow Lite downloads dependencies in an unusual way ... Let's so the same in our #BL602 Makefile
TensorFlow Lite Makefile looks complicated ... Let's download "gemmlowp" the simple way on #BL602
https://github.com/lupyuen/tflite-bl602/blob/main/bouffalo.mk#L52-L69
Our #BL602 TensorFlow Build hitting some Math errors ... Let's fix them
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
#BL602 Makefile for TensorFlow Lite needs this ... To fix the Math build errors
https://github.com/lupyuen/tflite-bl602/blob/main/bouffalo.mk#L21-L27
#BL602 TensorFlow Lite also needs the "ruy" library ... For matrix multiplication
https://github.com/lupyuen/tflite-bl602/blob/main/bouffalo.mk#L71-L82
Our #BL602 Build of TensorFlow Lite ... Fixing a few more missing C++ Functions
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
Source Folders for TensorFlow Lite are defined in the #BL602 Makefiles "bouffalo.mk" and "component.mk"
https://github.com/lupyuen/tflite-bl602/blob/main/bouffalo.mk
Our #BL602 Build of TensorFlow Lite calls "new" and "delete" to Allocate and Deallocate C++ Objects in Heap Memory ... But it's supposed to use Static Memory, not Heap Memory ... Let's find out why
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
Setting this flag will tell TensorFlow Lite to use Static Memory (instead of Heap Memory) on #BL602 ... Neat!
https://github.com/lupyuen/tflite-bl602/blob/main/bouffalo.mk#L46-L49
Final few Missing Functions for TensorFlow Lite on #BL602 ... Let's find out what they are
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
Just realised that "CPPFLAGS" works for building #BL602 C++ Libraries, but not for BL602 C++ Apps ... Dang
https://github.com/lupyuen/bl_iot_sdk/blob/tflite/customer_app/sdk_app_tflite/Makefile#L12-L20
Aha "CPPFLAGS" should be defined in #BL602 "bouffalo.mk" ... Not "Makefile" 🙄
We disable Thread-Safe Initialisation by setting "-fno-threadsafe-statics" ... This fixes the Missing Functions "__cxa_guard_acquire" and "__cxa_guard_release" in #BL602 TensorFlow
We set the #BL602 Global Destructor "__dso_handle" to null ... Since we're not destroying the Static TensorFlow Variables
#TensorFlow Lite builds OK on #BL602 yay! Let's flash and run the firmware! 🤩
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
#TensorFlow Lite runs OK on #BL602 yay! 🎉 This pre-trained TensorFlow Model is supposed to infer "y = sin(x)" ... Let's verify the output! 🥧
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
#BL602 runs #TensorFlow Lite Model that infers "y = sin(x)" ... Output looks reasonably accurate!
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
#TensorFlow Lite on #BL602 ... Now with a proper Command-Line Interface
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
How we might teach #BL602 ... To light up the LED 😂
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
We have a #TensorFlow Lite Model that generates a Sine Wave ... Let's use it to light up the #BL602 LED ... In a fun and interesting way!
https://github.com/lupyuen/bl_iot_sdk/tree/tflite/customer_app/sdk_app_tflite
How we glow the #BL602 LED ... With #TensorFlow Lite
Here's our Glowing LED on #PineCone #BL602 @ThePine64 ... Controlled by #TensorFlow Lite
What is #TensorFlow? Why run it on #BL602?
https://lupyuen.github.io/articles/tflite?2#tensorflow-lite-library
How we Build, Flash and Run #TensorFlow Lite Firmware on #RISCV #BL602
https://lupyuen.github.io/articles/tflite?4#tensorflow-lite-firmware
How we load a #TensorFlow Lite Model on #RISCV #BL602 ... And run an inference with the model
https://lupyuen.github.io/articles/tflite?5#machine-learning-in-action
How Accurate is our #TensorFlow Lite Model on #BL602? Can we do better?
https://lupyuen.github.io/articles/tflite?5#how-accurate-is-it
Creating a #TensorFlow Lite Model for #BL602 won't be easy ... Sorry Padme 😂
https://lupyuen.github.io/articles/tflite?7#train-tensorflow-model
#TensorFlow Lite needs these C++ Global Variables
How we init the #TensorFlow Lite Library on #BL602
https://lupyuen.github.io/articles/tflite?9#load-tensorflow-model
Running an Inference with #TensorFlow Lite Library on #BL602
https://lupyuen.github.io/articles/tflite?10#run-tensorflow-inference
Glowing the #BL602 LED with #TensorFlow Lite and Pulse Width Modulation
#BL602 #RISCV Firmware glowing the LED with #TensorFlow Lite
https://lupyuen.github.io/articles/tflite?12#glowing-machine-learning-in-action
#BL602 can't be used for training a #TensorFlow Lite Model ... Here's why
https://lupyuen.github.io/articles/tflite?15#train-tensorflow-model
What else can we do with #TensorFlow Lite on #BL602?
https://lupyuen.github.io/articles/tflite?16#what-else-can-tensorflow-do
#TensorFlow Lite on #BL602 needs 4 External Libraries: flatbuffers, pigweed, gemmlowp, ruy
https://lupyuen.github.io/articles/tflite?18#download-libraries
Global Destructor and Math Overflow for #TensorFlow Lite on #BL602
https://lupyuen.github.io/articles/tflite?19#global-destructor
How we Optimise #TensorFlow Lite for #RISCV
https://lupyuen.github.io/articles/tflite?20#optimise-tensorflow
Here's how we do Machine Learning with #TensorFlow Lite on #RISCV #BL602 ... To create a Glowing LED
@Blort So that we can run Machine Learning on BL602 🙂 I'll add more use cases soon
@lupyuen Ahhhhhh....
What is #TensorFlow Lite?
https://lupyuen.github.io/articles/tflite?3#tensorflow-lite-library