Cannot deploy tflite model on Arduino Portenta H7

Hello,
I had trained an object detection model in Edge Impulse and i downloaded the .zip file after the model is built in Edge Impulse and added my ZIP file in the Arduino IDE 1.8.15 and then uploaded the program from the examples. I followed the procedure from this link On your Arduino

I am getting the error struct_ei_impulse__result_t has no member named ‘classification’
Can anyone help me with this?
Thanks

Hello @shoebk971,

I just had a look at your project and it seems you are using an Object Detection model.
Object detection is currently only supported on Linux targets (Raspberry Pi, Jetson Nano, Macbook, …).

You would need to use some image classification instead of Object Detection (under the Create Impulse page in the Studio):

And you will also need to change the labeling method from Bounding boxes to One label per data item under the Dashboard page (bottom right corner):

Regards,

Louis

Hello, Thanks for replying. I had changed it to image classification and trained the model. However, when i am deploying it to my Arduino Portenta H7 using the Arduino IDE 1.8.15 i am getting an error which states Error compiling for board Arduino Portenta H7(M7 core).

Here is the error message…

Arduino: 1.8.15 (Windows 10), Board: “Arduino Portenta H7 (M7 core)”

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\ConvolutionFunctions\arm_convolve_HWC_q7_RGB.c: In function ‘arm_convolve_HWC_q7_RGB’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\ConvolutionFunctions\arm_convolve_HWC_q7_RGB.c:125:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

                     *__SIMD32(pBuffer) = 0x0;

                     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\ConvolutionFunctions\arm_convolve_HWC_q7_RGB.c:158:25: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

                     *__SIMD32(pBuffer) = __PKHBT(bottom.word, top.word, 0);

                     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_nn_mult_q15.c: In function ‘arm_nn_mult_q15’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_nn_mult_q15.c:98:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pDst)++ = __PKHBT(out2, out1, 16);

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_nn_mult_q15.c:99:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pDst)++ = __PKHBT(out4, out3, 16);

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_nn_mult_q7.c: In function ‘arm_nn_mult_q7’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_nn_mult_q7.c:80:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pDst)++ = __PACKq7(out1, out2, out3, out4);

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_q7_to_q15_reordered_no_shift.c: In function ‘arm_q7_to_q15_reordered_no_shift’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_q7_to_q15_reordered_no_shift.c:106:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pDst)++ = in2;

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\NNSupportFunctions\arm_q7_to_q15_reordered_no_shift.c:107:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pDst)++ = in1;

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\PoolingFunctions\arm_pool_q7_HWC.c: In function ‘compare_and_replace_if_larger_q7’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\PoolingFunctions\arm_pool_q7_HWC.c:78:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pIn)++ = in.word;

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\PoolingFunctions\arm_pool_q7_HWC.c: In function ‘accumulate_q7_to_q15’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\PoolingFunctions\arm_pool_q7_HWC.c:122:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pCnt)++ = __QADD16(vo1, in);

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\CMSIS\NN\Source\PoolingFunctions\arm_pool_q7_HWC.c:125:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

     *__SIMD32(pCnt)++ = __QADD16(vo2, in);

     ^

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\dsp\image\processing.cpp: In function ‘int ei::image::processing::yuv422_to_rgb888(unsigned char*, const unsigned char*, unsigned int, ei::image::processing::YUV_OPTIONS)’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\dsp\image\processing.cpp:73:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

 for (unsigned int i = 0; i < in_size_pixels; ++i) {

                          ~~^~~~~~~~~~~~~~~~

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\tensorflow\lite\core\api\op_resolver.cpp: In function ‘TfLiteStatus tflite::GetRegistrationFromOpCode(const tflite::OperatorCode*, const tflite::OpResolver&, tflite::ErrorReporter*, const TfLiteRegistration**)’:

C:\Users\Shoeb\Documents\Arduino\libraries\Face_Detection_inferencing\src\edge-impulse-sdk\tensorflow\lite\core\api\op_resolver.cpp:34:20: warning: comparison is always false due to limited range of data type [-Wtype-limits]

   builtin_code < BuiltinOperator_MIN) {

   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

C:\Users\Shoeb\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.3.1\cores\arduino\USB\USBCDC.cpp: In member function ‘virtual const uint8_t* arduino::USBCDC::configuration_desc(uint8_t)’:

C:\Users\Shoeb\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.3.1\cores\arduino\USB\USBCDC.cpp:538:35: warning: narrowing conversion of ‘((((arduino::USBCDC*)this)->arduino::USBCDC::extraDescriptor != 0) ? 5 : 0)’ from ‘int’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]

     (extraDescriptor != NULL) ? 0x5 : 0x0, // iInterface

     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

c:/users/shoeb/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/…/lib/gcc/arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: C:\Users\Shoeb\AppData\Local\Temp\arduino_build_56221/static_buffer1.ino.elf section .text' will not fit in region FLASH’

c:/users/shoeb/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/…/lib/gcc/arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region `FLASH’ overflowed by 4460 bytes

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Portenta H7 (M7 core).

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

Hi @shoebk971,

The image classification model seems too big for the Portenta:

z2017q4/bin/…/lib/gcc/arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: region `FLASH’ overflowed by 4460 bytes

As the Portenta H7 is still a Beta release, I would suggest checking this example instead: https://github.com/edgeimpulse/example-portenta-lorawan#training-a-new-model

We use 64x64 pixels grayscale images with a MobileNetV2 0.1 to train the model.

Aurelien