Question/Issue:
Hi, I know this issue already exist but I tried a different approach.
I had this problem with any model compiling with DEI_CLASSIFIER_TFLITE_ENABLE_ESP_NN_S3=1
on ESP-IDF 4.4.7 (All on VSCode)
So I replaced the “ESP_NN” folder with the current one from expressiff/esp-nn repo and modified some includes for it to work.
It compiles!! but now I keep getting this error before it reboots :
`Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4207d73e PS : 0x00060d30 A0 : 0x8207cb4e A1 : 0x3fcf32b0
0x4207d73e: tflite::MicroContext::GetScratchBuffer(int) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/micro_context.cc:44A2 : 0x3fce9c68 A3 : 0x00000000 A4 : 0x00000010 A5 : 0x3fcf3394
A6 : 0x00000010 A7 : 0x00000003 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x3d8709a4 A11 : 0x00000348 A12 : 0x8037b5de A13 : 0x3fc92760
A14 : 0x3fc94014 A15 : 0x3fc94014 SAR : 0x00000009 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0x00000000Backtrace: 0x4207d73b:0x3fcf32b0 0x4207cb4b:0x3fcf32d0 0x420461c5:0x3fcf32f0 0x420468c5:0x3fcf3420 0x42063dab:0x3fcf34e0 0x4205b665:0x3fcf3500 0x420088ff:0x3fcf3520 0x42008bde:0x3fcf3560 0x42008c45:0x3fcf35f0 0x42008c91:0x3fcf3610 0x4200910d:0x3fcf3710 0x420091aa:0x3fcf3730 0x4207ebec:0x3fcf39a0 0x4037c76d:0x3fcf39c0
0x4207d73b: tflite::MicroContext::GetScratchBuffer(int) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/micro_context.cc:420x4207cb4b: tflite::MicroContextGetScratchBuffer(TfLiteContext*, int) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/micro_context.h:139
0x420461c5: tflite::(anonymous namespace)::SoftmaxQuantized(TfLiteContext*, TfLiteEvalTensor const*, TfLiteEvalTensor*, tflite::(anonymous namespace)::NodeData const*) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/kernels/softmax.cc:335
0x420468c5: tflite::(anonymous namespace)::Eval(TfLiteContext*, TfLiteNode*) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/kernels/softmax.cc:390
0x42063dab: tflite::MicroGraph::InvokeSubgraph(int) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/micro_graph.cc:182
0x4205b665: tflite::MicroInterpreter::Invoke() at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/tensorflow/lite/micro/micro_interpreter.cc:302
0x420088ff: inference_tflite_run(ei_impulse const*, ei_learning_block_config_tflite_graph_t*, unsigned long long, TfLiteTensor*, TfLiteTensor*, TfLiteTensor*, tflite::MicroInterpreter*, unsigned char*, ei_impulse_result_t*, bool) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/inferencing_engines/tflite_micro.h:178
0x42008bde: run_nn_inference_image_quantized(ei_impulse const*, ei::ei_signal_t*, ei_impulse_result_t*, void*, bool) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/inferencing_engines/tflite_micro.h:416
0x42008c45: run_classifier_image_quantized at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_run_classifier.h:610
0x42008c91: process_impulse at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_run_classifier.h:230
0x4200910d: run_classifier at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_run_classifier.h:813
0x420091aa: app_main at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/main/main.cpp:124
0x4207ebec: main_task at /home/tomas/esp/v4.4.7/esp-idf/components/freertos/port/port_common.c:141 (discriminator 2)
0x4037c76d: vPortTaskWrapper at /home/tomas/esp/v4.4.7/esp-idf/components/freertos/port/xtensa/port.c:142
The model I tried is a FOMO MovileNetv2 0.35 122x122 RGB
Project ID:
378540
Context/Use case:
Object recognition on different esp32s3 boards
More Context:
Tried running it without any ESP-NN optimization and it works between a lot of
E (19367) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time: E (19367) task_wdt: - IDLE0 (CPU 0)
errors.
Update: Setting Optimization Level to “Optimize for performance” got rid of the problem.
Also tried a YOLOv5 - Nano 320x320 RGB with both methods and it wont work because of the Task watchdog got triggered
error.
Also² on ESP-IDF 5.0.1 without “ESP_NN” it reboots with this error:
assert failed: remove_free_block tlsf.c:330 (prev && “prev_free field can not be null”)
Backtrace: 0x40375b52:0x3fc9a5a0 0x4037a7a1:0x3fc9a5c0 0x403801f1:0x3fc9a5e0 0x4037f56c:0x3fc9a700 0x4037f36b:0x3fc9a720 0x403762da:0x3fc9a740 0x40380235:0x3fc9a760 0x4200b065:0x3fc9a780 0x42009024:0x3fc9a7a0 0x4200a6a1:0x3fc9a7c0 0x4200a725:0x3fc9a890 0x4200abde:0x3fc9a940 0x4206721b:0x3fc9abb0
0x40375b52: panic_abort at /home/tomas/esp/v5.2.1/esp-idf/components/esp_system/panic.c:472
0x4037a7a1: esp_system_abort at /home/tomas/esp/v5.2.1/esp-idf/components/esp_system/port/esp_system_chip.c:93
0x403801f1: __assert_func at /home/tomas/esp/v5.2.1/esp-idf/components/newlib/assert.c:81
0x4037f56c: remove_free_block at /home/tomas/esp/v5.2.1/esp-idf/components/heap/tlsf/tlsf.c:330 (discriminator 1)
(inlined by) block_remove at /home/tomas/esp/v5.2.1/esp-idf/components/heap/tlsf/tlsf.c:380 (discriminator 1)
(inlined by) block_merge_prev at /home/tomas/esp/v5.2.1/esp-idf/components/heap/tlsf/tlsf.c:470 (discriminator 1)
(inlined by) tlsf_free at /home/tomas/esp/v5.2.1/esp-idf/components/heap/tlsf/tlsf.c:1122 (discriminator 1)
0x4037f36b: multi_heap_free_impl at /home/tomas/esp/v5.2.1/esp-idf/components/heap/multi_heap.c:234
(inlined by) multi_heap_free_impl at /home/tomas/esp/v5.2.1/esp-idf/components/heap/multi_heap.c:223
0x403762da: heap_caps_free at /home/tomas/esp/v5.2.1/esp-idf/components/heap/heap_caps.c:393
0x40380235: free at /home/tomas/esp/v5.2.1/esp-idf/components/newlib/heap.c:39
0x4200b065: ei_free(void*) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/porting/espressif/ei_classifier_porting.cpp:100
0x42009024: (anonymous namespace)::ei_aligned_free(void*) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_aligned_malloc.h:102
0x4200a6a1: std::unique_ptr<void, void ()(void)>::~unique_ptr() at /home/tomas/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/unique_ptr.h:404 (discriminator 1)
(inlined by) run_nn_inference_image_quantized(ei_impulse const*, ei::ei_signal_t*, ei_impulse_result_t*, void*, bool) at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/inferencing_engines/tflite_micro.h:433 (discriminator 1)
0x4200a725: process_impulse at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_run_classifier.h:610
(inlined by) process_impulse at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_run_classifier.h:230
0x4200abde: app_main at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/edge-impulse-sdk/classifier/ei_run_classifier.h:813
(inlined by) app_main at /home/tomas/ESP32_VSCODE/example-standalone-inferencing-espressif-esp32s3/main/main.cpp:124
0x4206721b: main_task at /home/tomas/esp/v5.2.1/esp-idf/components/freertos/app_startup.c:208