Nicla Vision Deployment Error: `.text' will not fit in region `FLASH'

Question/Issue: I am using a Nicla Vision to classify 5 objects. I have used the 96 x 95 frame. I have taken 20 images for each object. I have chosen Auto-balance dataset and Data augmentation. 30 learning cycles, learning rate of 0.005, and 20% validation size. There is an accuracy of only 55%, however, Live classification works reasonably well. When I try to build the deployment, and also choosing the Quantized compiler, I am getting the error

 /root/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino-sketch-678B6DF46E949D293299A3BDECCBC03B/firmware-arduino-nicla-vision.ino.elf section `.text' will not fit in region `FLASH'
/root/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 316808 bytes
collect2: error: ld returned 1 exit status

However, the spec of the Nicla Vision is
2MB Flash/1MB RAM
16MB QSPI Flash for storage

But the compiler states that the memory being used is 346.9K, and the flash usage is 581.0K.

Can anyone help me understand why this error is coming up?

Project ID: 195513

Context/Use case: Image classification

Let’s start with the obvious. How many bytes is firmware-arduino-nicla-vision.ino.elf

When your say But the compiler states that the memory being used is 346.9K, and the flash usage is 581.0K. I assume you are referring to the Edge Impulse (EI) Studio Deployment page that shows the estimate of about 350k RAM and 580k Flash for the EI library only. That estimate does not include the memory needed for your code. So it seems your custom code is greater than ~1.5M and does not fit onto the Nicla. I suspect your are #includeing more that you need. Try creating a super simple program that basically just includes the EI C++ library and see if you can program the Nicla.