Error during the building of the firmware

Hi,

I tried to build a firmware for OpenMV. During the process I received

Creating job... OK (ID: 2410037)

Writing templates...
Scheduling job in cluster...
Job started
Exporting TensorFlow Lite model...
Found operators ['Add', 'Conv2D', 'DepthwiseConv2D', 'FullyConnected', 'Reshape', 'Softmax', 'Pad']
Exporting TensorFlow Lite model OK

Removing clutter...
Removing clutter OK

Copying output...
Copying output OK

Scheduling job in cluster...
Job started
Copy image classification example
Building firmware...
GEN /app/openmv/src/NICLAV_build/lib/libtf/libtf_builtin_models.c
GEN /app/openmv/src/NICLAV_build/lib/libtf/libtf_builtin_models.h
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Including User C Module from /app/openmv/src/omv/modules
GEN /app/openmv/src/NICLAV_build/micropython/genhdr/mpversion.h
CC ../../extmod/moduplatform.c
CC ../../shared/runtime/pyexec.c
CC moduos.c
CC /app/openmv/src/omv/modules/py_tf.c
GEN /app/openmv/src/NICLAV_build/micropython/frozen_content.c
/opt/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /app/openmv/src/NICLAV_build/bin/firmware.elf section `.text' will not fit in region `FLASH_TEXT'
/opt/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_TEXT' overflowed by 226500 bytes
collect2: error: ld returned 1 exit status
make: *** [omv/ports/stm32/omv_portconfig.mk:655: firmware] Error 1
Building firmware OK

Copying artefacts...
Copying artefacts OK

Job completed

As you can see Error 1. I have a OpenMV H7 camera. When I flash the camera with the firmware and start the python code which is also delivered with the build process. I get the error message that the file “trained” is not found. It comes from the codepart:

try:
    # Load built in model
    labels, net = tf.load_builtin_model('trained')
except Exception as e:
    raise Exception(e)

I guess this problem is connected to the error during the build process. Am I right? What can I do to avoid the problem?

Hello @ftekin,

It seems that your model is too big for your board.

Could you try with a smaller version of the MobileNet model (MobileNetV1 96x96 0.1 for example).

Regards,

Louis

Hi, i’m also facing the similar problem in OpenMV H7 plus hardware. I tested with MobilenetV2 160 * 160 image classification (not ssd) then I used the lowest model Mobilenet 96 * 96. Facing the same issue.

Creating job... OK (ID: 2480171)

Writing templates...
Scheduling job in cluster...
Job started
Exporting TensorFlow Lite model...
/usr/local/lib/python3.8/dist-packages/numpy/ma/core.py:4466: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.shape is ():
Found operators ['Add', 'Conv2D', 'DepthwiseConv2D', 'FullyConnected', 'Reshape', 'Softmax', 'Pad']
Exporting TensorFlow Lite model OK

Removing clutter...
Removing clutter OK

Copying output...
Copying output OK

Scheduling job in cluster...
Job started
Copy image classification example
Building firmware...
GEN /app/openmv/src/NICLAV_build/lib/libtf/libtf_builtin_models.c
GEN /app/openmv/src/NICLAV_build/lib/libtf/libtf_builtin_models.h
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Including User C Module from /app/openmv/src/omv/modules
Attached to job 2480171...
GEN /app/openmv/src/NICLAV_build/micropython/genhdr/mpversion.h
CC ../../extmod/moduplatform.c
CC ../../shared/runtime/pyexec.c
CC moduos.c
GEN /app/openmv/src/NICLAV_build/micropython/frozen_content.c
CC /app/openmv/src/omv/modules/py_tf.c
/opt/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: /app/openmv/src/NICLAV_build/bin/firmware.elf section `.text' will not fit in region `FLASH_TEXT'
/opt/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_TEXT' overflowed by 229288 bytes
collect2: error: ld returned 1 exit status
make: *** [omv/ports/stm32/omv_portconfig.mk:655: firmware] Error 1
Building firmware OK

Copying artefacts...
Copying artefacts OK

Job completed

Hi,

I selected mobilent v2 96by96 0.05, and it builds the firmware and even I can run it in the H7 Plus hardware. Initially, I selected mobilenet v2 96by96 0.35 where it did not build properly.

1 Like