How to set up and use ESP-NN?

gcoladon
Posts: 1
Joined: Tue Oct 15, 2024 12:39 am

How to set up and use ESP-NN?

Postby gcoladon » Tue Oct 15, 2024 12:54 am

When I tried to follow the Configuration section of https://github.com/espressif/esp-nn, which states
"To configure, please use idf.py menuconfig and under ESP-NN select NN_OPTIMIZATIONS"
by cloning the repo, cd'ing into it, and running "idf.py menuconfig", I get this error:
CMake Error at CMakeLists.txt:48 (idf_component_register):
Unknown CMake command "idf_component_register".
I also can't figure out if I should be cloning this repo as a sibling of the esp-idf and esp-who repos, or if it should properly be a component of one or the other.

As an aside, when I try to search the forum for "esp-nn", I get this feedback:
Searched query: esp-nn
ignored: nn
Apparently nn is considered meaningless by virtue of being just two letters.

So please forgive me if there are a bunch of forum topics on esp-nn already; I wasn't able to find them.

nopnop2002
Posts: 111
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: How to set up and use ESP-NN?

Postby nopnop2002 » Wed Oct 16, 2024 10:51 pm

Code: Select all

git clone https://github.com/espressif/esp-nn
cd esp-nn
cd test_app/
idf.py build monitor -p /dev/ttyUSB0

I (313) main_task: Started on CPU0
I (323) main_task: Calling app_main()
I (323) test_app: Running s8 tests...
esp_nn_add_elementwise_s8_test[0] passed
esp_nn_add_elementwise_s8_test[1] passed
esp_nn_add_elementwise_s8_test[2] passed
esp_nn_add_elementwise_s8_test[3] passed
esp_nn_add_elementwise_s8_test[4] passed
esp_nn_add_elementwise_s8_test[5] passed
esp_nn_add_elementwise_s8_test[6] passed
esp_nn_add_elementwise_s8_test[7] passed
esp_nn_add_elementwise_s8_test[8] passed
esp_nn_add_elementwise_s8_test[9] passed
add, c 311840 opt 298540
esp_nn_mul_elementwise_s8_test[0] passed
esp_nn_mul_elementwise_s8_test[1] passed
esp_nn_mul_elementwise_s8_test[2] passed
esp_nn_mul_elementwise_s8_test[3] passed
esp_nn_mul_elementwise_s8_test[4] passed
esp_nn_mul_elementwise_s8_test[5] passed
esp_nn_mul_elementwise_s8_test[6] passed
esp_nn_mul_elementwise_s8_test[7] passed
esp_nn_mul_elementwise_s8_test[8] passed
esp_nn_mul_elementwise_s8_test[9] passed
mul, c 139201 opt 135409

######## Running esp_nn_depthwise_conv_s8_test ##########
[  0] passed [pad: (0, 0), stride: (1, 1) out: ( 16, 16), filter: (3, 3, 16), ch_mult 1]        cycles: c  1241582, opt   705948
[  1] passed [pad: (1, 1), stride: (1, 1) out: ( 10, 10), filter: (3, 3, 16), ch_mult 1]        cycles: c   455236, opt   245305
[  2] passed [pad: (1, 1), stride: (1, 1) out: ( 10, 10), filter: (3, 3, 24), ch_mult 1]        cycles: c   681432, opt   362722
[  3] passed [pad: (1, 1), stride: (1, 1) out: ( 10, 10), filter: (3, 3, 24), ch_mult 1]        cycles: c   682052, opt   362773
[  4] passed [pad: (1, 1), stride: (1, 1) out: (  6,  6), filter: (3, 3,  4), ch_mult 8]        cycles: c   276156, opt   165947
[  5] passed [pad: (1, 1), stride: (1, 1) out: ( 12, 12), filter: (5, 5,  4), ch_mult 8]        cycles: c  1804846, opt   952032
[  6] passed [pad: (1, 1), stride: (1, 1) out: (  6,  6), filter: (3, 3,  4), ch_mult 4]        cycles: c   142276, opt    80331
[  7] passed [pad: (0, 0), stride: (2, 2) out: (  2,  2), filter: (3, 3, 16), ch_mult 1]        cycles: c    19933, opt    11457
[8] allocations failed
[  9] passed [pad: (0, 0), stride: (2, 2) out: (  2,  2), filter: (3, 3, 16), ch_mult 1]        cycles: c    19922, opt    11441
[ 10] passed [pad: (1, 1), stride: (2, 2) out: (  3,  3), filter: (3, 3, 16), ch_mult 1]        cycles: c    40425, opt    21742
[ 11] passed [pad: (0, 0), stride: (2, 2) out: (  2,  2), filter: (3, 3, 16), ch_mult 1]        cycles: c    19981, opt    11453
[ 12] passed [pad: (0, 0), stride: (1, 1) out: (  4,  4), filter: (3, 3, 16), ch_mult 1]        cycles: c    77431, opt    43315
[ 13] passed [pad: (0, 0), stride: (1, 1) out: (  4,  4), filter: (3, 3, 16), ch_mult 1]        cycles: c    77485, opt    43283
[ 14] passed [pad: (0, 0), stride: (2, 2) out: (  2,  2), filter: (3, 3, 16), ch_mult 1]        cycles: c    19947, opt    11463

######## Running esp_nn_conv_s8_test ##########
[  0] passed [pad: (0, 0), stride: (1, 1) out: ( 10, 10, 64), filter: (1, 1, 64)]       cycles: c  5100678, opt  3692941
[  1] passed [pad: (0, 0), stride: (1, 1) out: (  4,  4,  8), filter: (1, 1, 20)]       cycles: c    47545, opt    33268
[  2] passed [pad: (0, 0), stride: (1, 1) out: (  8,  8, 64), filter: (3, 3,  3)]       cycles: c  2312226, opt  2545923
[  3] passed [pad: (0, 0), stride: (1, 1) out: ( 10, 10, 64), filter: (1, 1,  3)]       cycles: c  1176580, opt   738284
[  4] passed [pad: (1, 1), stride: (1, 1) out: ( 10, 10, 64), filter: (3, 3, 12)]       cycles: c  7791060, opt  7618953
[  5] passed [pad: (0, 0), stride: (2, 2) out: (  8,  8, 16), filter: (1, 1, 16)]       cycles: c   326335, opt   222712
[  6] passed [pad: (0, 0), stride: (1, 1) out: (  2,  2,  8), filter: (1, 1,  8)]       cycles: c     9789, opt     6508
[  7] passed [pad: (0, 0), stride: (2, 2) out: ( 54, 54, 16), filter: (6, 6,  3)]       cycles: c 83165524, opt 96193690
[  8] passed [pad: (0, 0), stride: (2, 2) out: (  2,  2, 16), filter: (6, 6,  5)]       cycles: c   162252, opt   198892
[  9] passed [pad: (1, 1), stride: (1, 1) out: (  3,  3,  1), filter: (3, 3, 32)]       cycles: c    19802, opt    15894
[ 10] passed [pad: (0, 0), stride: (1, 1) out: (  8,  8, 16), filter: (1, 1, 16)]       cycles: c   327036, opt   222616
[ 11] passed [pad: (0, 0), stride: (1, 1) out: (  8,  8, 16), filter: (1, 1, 16)]       cycles: c   325362, opt   222685
[ 12] passed [pad: (0, 0), stride: (1, 1) out: (  8,  8, 16), filter: (1, 1, 16)]       cycles: c   325695, opt   222644
[ 13] passed [pad: (0, 0), stride: (1, 1) out: (  8,  8, 16), filter: (1, 1, 16)]       cycles: c   325240, opt   222668
[ 14] passed [pad: (0, 0), stride: (1, 1) out: (  8,  8, 16), filter: (1, 1, 16)]       cycles: c   325804, opt   222644
esp_nn_relu6_s8_test passed
relu, c 22297 opt 21024
esp_nn_avg_pool_s8_test passed
avg_pool, c 637378 opt 629154
esp_nn_max_pool_s8_test passed
max_pool, c 640778 opt 634455

######## Running esp_nn_fully_connected_s8_test ##########
[  0] passed [row_len 271, out_ch 3]    cycles: c    15639, opt     9938
[  1] passed [row_len 271, out_ch 3]    cycles: c     9307, opt     9306
[  2] passed [row_len 271, out_ch 3]    cycles: c     9309, opt     9308
[  3] passed [row_len 271, out_ch 3]    cycles: c     9309, opt     9308
[328965] passed [row_len 1, out_ch 16]  cycles: c     1724, opt     1723
esp_nn_softmax_s8_test passed
softmax, c 201297 opt 122715
I (2163) test_app: s8 tests done!

I (2163) main_task: Returned from app_main()

Who is online

Users browsing this forum: No registered users and 382 guests