Hi,
I try to modify the basic Audiomoth firmware with simplicity studio to run a simple inference of a neural network model. I want to use the Tensorflow Lite Micro API from the gecko SDK.
For the moment, I can compile the firmware with both audiomoth code and TFLM from the SDK, but there must be a runtime error as the audiomoth keeps rebooting (switch in USB position). At the moment I need to further investigate with an external debugger.
My question : have you ever tried runing TFLite micro on Audiomoth, if yes woud you have any tips/advices/link or document ?
Thanks !
Louis
Thanks, I'll have a look !
I'm aware that the size of the models must be small. For the ram memory however, don't you think the external 256kB SRAM could be used by the TFLM runtime api ?
I am surprised by the memory clash as I though that a fixed-size "memory tensor arena" was pre-allocated in RAM by TFLM, and I thought that not so much ram would be allocated after that.
For the reset, it typicaly happens after 2 seconds so I think it might come from somewhere else than the watchdog timer.
Thanks a lot for your thoughts on my experients !
Louis
EDIT: Oh I see, it is not TFLiteMicro so it works differently, without "tensor arena"
Hi Louis, Have a look at the AudioMoth-EdgeImpulse firmware here - https://github.com/OpenAcousticDevices/AudioMoth-EdgeImpulse. This uses Tensorflow Lite to run models exported from the Edge Impulse platform. This worked at the time (the Edge Impulse platform may have moved on since we did this) but the models have to be very small and have to use very little RAM when running - typically less than 10kB. Tensorflow Lite uses the stack a lot during computation and it's quite likely that you are running out of memory. We also had to modify the ei_malloc function to check that the heap was not clashing with the bottom of the stack.
The AudioMoth will also reset if you aren't feeding the watchdog timer. It takes about 30 seconds for the watchdog timer to overflow and cause a reset. Feeding the watchdog happens automatically in the standard firmware when acquiring microphone samples, but if your code is running for long periods without doing this it may be resetting for this reason.
Alex