Arduino_TensorFlowLite_ESP32
Arduino_TensorFlowLite_ESP32 copied to clipboard
which tensorlfow version support for arduino TensorFlowLite_ESP32 1.0.0
Hey i am trying to run person detection esp32 cam after converting into c source file of image classification mobilenet v1 with 0.25 but getting reboot error. so please ket me know which version of tf should i chose to convert from tf model to c source
I may be late for the party but here you go.
- first, check if brownout detector is disabled. If not, disable it.
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
- if your model is a big one, then it will use a lot of Internal RAM causing ESP32 to reboot. you can allocate memory on PSRAM for your model and TensorArena. This may solve your issue.
in .ino file:
if (tensor_arena == NULL) {
//allocate memory for TensorArena on PSRAM
tensor_arena = (uint8_t *) ps_malloc(kTensorArenaSize);
}
in model.cc file:
// allocate memory in PSRAM for the model
alignas(8) const unsigned char g_person_detect_model_data[] __attribute__((section(".psram.data"))) = {
0x1c, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0e, 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00,
.....}
- If still not working, you may have to train your model to be smaller. You can use weights of MobileNet models trained on greyscale images to create your base model and do transfer learning. Using greyscale images may lower RAM usage during inference.
here is the Git repo of greyscale MobileNet weights: https://github.com/Navodplayer1/MobileNet_96x96_greyscale_weights