Error compiling Arduino Library for XIAO ESP32S3 Sense

Question/Issue:
Hi all.
I’m trying to deploy a Vision project - just an example - by detecting plants or lamps, but when compiling the project for the XIAO ESP32S3 Sense (same as an ESP32 EYE CAM), I get the following errors:

/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp: In function 'TfLiteStatus tflite::{anonymous}::Prepare(TfLiteContext*, TfLiteNode*)':
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp:1789:67: error: either all initializer clauses should be designated or none of them should be
 1789 |                                 .channels = input->dims->data[3], 1
      |                                                                   ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp:1793:68: error: either all initializer clauses should be designated or none of them should be
 1793 |                                 .channels = output->dims->data[3], 1
      |                                                                    ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp:1795:80: error: either all initializer clauses should be designated or none of them should be
 1795 |     data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
      |                                                                                ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp: In function 'void tflite::{anonymous}::EvalQuantizedPerChannel(TfLiteContext*, TfLiteNode*, const TfLiteConvParams&, const NodeData&, const TfLiteEvalTensor*, const TfLiteEvalTensor*, const TfLiteEvalTensor*, TfLiteEvalTensor*)':
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp:1883:58: error: either all initializer clauses should be designated or none of them should be
 1883 |                                 .channels = input_depth, 1
      |                                                          ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp:1887:59: error: either all initializer clauses should be designated or none of them should be
 1887 |                                 .channels = output_depth, 1
      |                                                           ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/conv.cpp:1889:80: error: either all initializer clauses should be designated or none of them should be
 1889 |     data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
      |                                                                                ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp: In function 'void tflite::{anonymous}::EvalQuantizedPerChannel(TfLiteContext*, TfLiteNode*, const TfLiteDepthwiseConvParams&, const NodeData&, const TfLiteEvalTensor*, const TfLiteEvalTensor*, const TfLiteEvalTensor*, TfLiteEvalTensor*)':
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp:1727:58: error: either all initializer clauses should be designated or none of them should be
 1727 |                                 .channels = input_depth, 1
      |                                                          ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp:1731:59: error: either all initializer clauses should be designated or none of them should be
 1731 |                                 .channels = output_depth, 1
      |                                                           ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp:1733:80: error: either all initializer clauses should be designated or none of them should be
 1733 |     data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
      |                                                                                ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp: In function 'TfLiteStatus tflite::{anonymous}::Prepare(TfLiteContext*, TfLiteNode*)':
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp:1836:67: error: either all initializer clauses should be designated or none of them should be
 1836 |                                 .channels = input->dims->data[3], 1
      |                                                                   ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp:1840:68: error: either all initializer clauses should be designated or none of them should be
 1840 |                                 .channels = output->dims->data[3], 1
      |                                                                    ^
/home/feiticeir0/Documents/Arduino/libraries/XIAO_Lamps_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/depthwise_conv.cpp:1842:80: error: either all initializer clauses should be designated or none of them should be
 1842 |     data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
      |                                                                                ^

exit status 1

Compilation error: exit status 1

Project ID:
Project ID is: 305878

This is based on this tutorial from edge impulse - https://www.youtube.com/watch?v=2wvbgsjpt2U&ab_channel=EdgeImpulse

It’s an image classification project - Is a lamp or a plant - or nothing.

Context/Use case:

I’m just trying an example to deploy .

Any help would be appreciated. Thank you

1 Like

Hi all.
I’ve solved the problem by using the solution from here:
https://www.hackster.io/mjrobot/tinyml-made-easy-image-classification-cb42ae#toc-connecting-sense-module–expansion-board-2

Just editing the file ei_classifier_config.h in exported Arduino library folder: /scr/edge-impulse-sdk/classifier/:

Disabling #define EI_CLASSIFIER_TFLITE_ENABLE_ESP_NN 1 and set it to 0 will allow the project to compile .

Thank you

5 Likes

Great thanks for sharing the solution @feiticeir0 !

Best

Eoin

Hi all.
I’ve solved the problem by using the solution from here too, in my case I had the same issue, and it was figured out by using the pointed-out solution.

Thanks so much.

Thank you so much for posting the solution as well. Really appreciate this saving my time😁

I don’t think this is the best way to do this. Correct me if I’m wrong, but I think you’re just disabling ESP_NN, which will significantly slow down performance. Instead just fill in the missing property names where it shows the errors (3rd one is .channels and 4th one is .extra)

1 Like