Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp_nn.h File During Compilation with -D ESP_NN (TFMIC-34) #91

Closed
pravee625 opened this issue Aug 1, 2024 · 5 comments
Closed

esp_nn.h File During Compilation with -D ESP_NN (TFMIC-34) #91

pravee625 opened this issue Aug 1, 2024 · 5 comments

Comments

@pravee625
Copy link

When I include the -D ESP_NN flag in my platformio.ini, I encounter the following error during compilation:

Compiling .pio\build\esp-wrover-kit\libde0\tfmicro\tensorflow\lite\micro\kernels\esp_nn\add.cc.o
Compiling .pio\build\esp-wrover-kit\libde0\tfmicro\tensorflow\lite\micro\kernels\esp_nn\conv.cc.o
lib/tfmicro/tensorflow/lite/micro/kernels/esp_nn/add.cc:34:10: fatal error: esp_nn.h: No such file or directory



#include <esp_nn.h>
^~~~~~~~~~
compilation terminated.
Compiling .pio\build\esp-wrover-kit\libde0\tfmicro\tensorflow\lite\micro\kernels\esp_nn\depthwise_conv.cc.o
*** [.pio\build\esp-wrover-kit\libde0\tfmicro\tensorflow\lite\micro\kernels\esp_nn\add.cc.o] Error 1
lib/tfmicro/tensorflow/lite/micro/kernels/esp_nn/conv.cc:30:10: fatal error: esp_nn.h: No such file or directory



#include <esp_nn.h>
^~~~~~~~~~
compilation terminated.
*** [.pio\build\esp-wrover-kit\libde0\tfmicro\tensorflow\lite\micro\kernels\esp_nn\conv.cc.o] Error 1
lib/tfmicro/tensorflow/lite/micro/kernels/esp_nn/depthwise_conv.cc:30:10: fatal error: esp_nn.h: No such file or directory



#include <esp_nn.h>
^~~~~~~~~~
compilation terminated.
*** [.pio\build\esp-wrover-kit\libde0\tfmicro\tensorflow\lite\micro\kernels\esp_nn\depthwise_conv.cc.o] Error 1
========================================================= [FAILED] Took 31.34 seconds =========================================================

  • The terminal process "C:\Users\prave.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
  • Terminal will be reused by tasks, press any key to close it.

When I remove the -D ESP_NN flag from my platformio.ini, the compilation is successful.

Is the esp_nn.h file not present in the esp-tflite-micro library?
How can I properly include the ESP-NN library while compiling in PlatformIO?

I am attaching my platformio.ini file for your reference
image

@github-actions github-actions bot changed the title esp_nn.h File During Compilation with -D ESP_NN esp_nn.h File During Compilation with -D ESP_NN (TFMIC-34) Aug 1, 2024
@vikramdattu
Copy link
Collaborator

@pravee625 is this issue still valid after #93 is addressed?

@pravee625
Copy link
Author

@vikramdattu Yes, I am still unable to compile with -D ESP_NN if declared in my platformio.ini file

if ESP_NN is declared in platformio.ini
then esp_nn.h file is required


and I am unable to find that file in the current repo...

@vikramdattu
Copy link
Collaborator

vikramdattu commented Aug 7, 2024

Hi @pravee625 esp-nn is separate component and with esp-idf's build system, it gets pulled in transparently as a dependency to esp-tflite-micro. This happens via dependency specified in idf_component.yml:

espressif/esp-nn:
version: "^1.0.0-rc1"
pre_release: true


For platform.io, can you please follow this piece of documentation?
esp-nn can be cloned from here and you can then add it manually as per above documentation.

@pravee625
Copy link
Author

pravee625 commented Aug 8, 2024

Thanks for the help @vikramdattu. My code is working fine, and esp_nn is successfully integrated. You can close this issue as well as the other issue: #90. The previous issue was also caused by esp_nn optimizations not being included. Now, my inference time has decreased from 900ms to 200ms.
image

@vikramdattu
Copy link
Collaborator

Hi @pravee625 thanks for the confirmation. Closing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants