ESP32-S3 TensorFlow Lite Model Issues

D4R3N_
Posts: 9
Joined: Sat Jan 04, 2020 6:40 pm

ESP32-S3 TensorFlow Lite Model Issues

Postby D4R3N_ » Mon Jun 27, 2022 9:54 am

I worked with the new ESP32-S3 Development Board and an I2S microphone in order to create a simple voice recognition system. The software and firmware behind this are based on this project: Voice Controlled Robot - Atomic14 https://github.com/atomic14/voice-controlled-robot


This project worked flawlessly on the developer kit so I moved forward and created my own board. This schematic is inspired by the design made by Espressif: ESP32-s3 Dev Kit Schematics https://dl.espressif.com/dl/SCH_ESP32-S ... 10312C.pdf

The flashing works perfectly. I am able to use different code that uses the microphone and record sounds. No issues with programming whatsoever. But when I upload the same code that uses TFLITE (the first provided link), the code uploads, runs, and prints outputs, but the neural network does not process or output anything.


**Please note** that there are no differences between the code uploaded to my board and the one uploaded to the dev kit (on which everything works as it should).

There are only small differences between the two boards, but everything else (code-wise) works on my board so I am not sure what hardware issue would affect only the neural network.

The ESP32-s3 used in my design is the same one as the one on the dev kit, the only difference is the 16MB Flash in my design and 8MB Flash in the ESP32-s3 dev kit design (smaller flash memory on the board that works with the nn, compared to larger flash on the board that doesn't work with the nn).


-> Could it be a memory problem caused by an incorrectly used capacitor that could create small differences in the voltage that powers the memory?


My schematics design is attached below
2022-06-27 104239.png
ESP32-s3 my PCB design for the voice recognition module
2022-06-27 104239.png (305.09 KiB) Viewed 4500 times
Thank you so much for any further questions, advice or tips!

D4R3N_
Posts: 9
Joined: Sat Jan 04, 2020 6:40 pm

Re: ESP32-S3 TensorFlow Lite Model Issues

Postby D4R3N_ » Mon Jun 27, 2022 4:00 pm

The only thing regarding the memory that is printed out is the following message during every reset: "Loading model 12 bytes lost due to alignment. To avoid this loss, please make sure the tensor_arena is 16 bytes aligned. Used bytes 22644". I have not been paying attention to this (for now) as the message is printed out when flashed on the dev kit as well (and the network works on there).


What happens during the runtime of the firmware is that everything works exactly as it should only the network outputs "0" for the probabilities for all of the outputs rather than real numbers.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 TensorFlow Lite Model Issues

Postby ESP_Sprite » Tue Jun 28, 2022 12:34 am

Probably easier to figure out why things go wrong rather than looking at it as a black box and going 'it no work'. For instance: can you dump what the ESP sees on the audio input? Perhaps that's all 0 for some reason?

Edit: Moving this topic to General Discussion as it doesn't have much to do with ADF. I also closed the duplicate topic in IoT solutions.

ESP_Vikram
Posts: 25
Joined: Fri Nov 23, 2018 12:07 pm

Re: ESP32-S3 TensorFlow Lite Model Issues

Postby ESP_Vikram » Tue Jun 28, 2022 4:48 am

As ESP_Sprite suggested, can you please check if audio input is proper?
You could make run `micro-speech` example run first and proceed from there.: https://github.com/espressif/tflite-mic ... cro_speech The example just detects `Yes` and `No` keywords.

D4R3N_
Posts: 9
Joined: Sat Jan 04, 2020 6:40 pm

Re: ESP32-S3 TensorFlow Lite Model Issues

Postby D4R3N_ » Tue Jun 28, 2022 8:52 am

ESP_Sprite wrote:
Tue Jun 28, 2022 12:34 am
Probably easier to figure out why things go wrong rather than looking at it as a black box and going 'it no work'. For instance: can you dump what the ESP sees on the audio input? Perhaps that's all 0 for some reason?

Edit: Moving this topic to General Discussion as it doesn't have much to do with ADF. I also closed the duplicate topic in IoT solutions.
Thanks for that. Yeah, the sound is completely fine as I have a similar code that does record sounds and then makes the file available for download.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 TensorFlow Lite Model Issues

Postby ESP_Sprite » Wed Jun 29, 2022 2:07 am

Hm. If anything, I don't see anything in your schematic that can cause things like that; your hardware design seems solid...

Who is online

Users browsing this forum: No registered users and 185 guests