Error flashing Nicla Vision with OpenMV Firmware

Hello,

i am currently trying to get a OpenMV firmware from edge impulse on a Nicla vision to work.

I followed all instructions from the following tutotial under the point “Deploying your impulse as an OpenMV firmware

After flashing the new firmware (the .bin file from edge impulse) on the nicla vision the blue LED is blinking.

But when I try to run the included micropython-skript from edge impulse the following error occurs:

Exeption: Could not find the file and line 19 from the code is highlighted.

I hope you can help me with this error, because I really dont know what I did wrong. Thank you.

This is the .py skript included in edge impulse:

# Edge Impulse - OpenMV Image Classification Example

import sensor, image, time, os, tf, uos, gc

sensor.reset()                         # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565)    # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
sensor.set_windowing((240, 240))       # Set 240x240 window.
sensor.skip_frames(time=2000)          # Let the camera adjust.

#net = None
#labels = None

try:
    # Load built in model
 labels, net = tf.load_builtin_model('trained')   
 found = False
except Exception as e:
    raise Exception(e)                          <-- Highlighted line 19


clock = time.clock()
while(True):
    clock.tick()

    img = sensor.snapshot()

    # default settings just do one detection... change them to search the image...
    for obj in net.classify(img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
        print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
        img.draw_rectangle(obj.rect())
        # This combines the labels and confidence values into a list of tuples
        predictions_list = list(zip(labels, obj.output()))

        for i in range(len(predictions_list)):
            print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))

    print(clock.fps(), "fps")

Hi @gom9sgm

Let me join your project now and investigate this, can you please is there anything else that was modified or specific to your environment?

Best

Eoin

Hi @Eoin

I dont know exactly what you mean. I’m using an arduino nicla vision. I connected it to my PC and downloaded OpenMV.
After that I took images with the nicla vision and sent them to my edge impulse project. Then I created a model and under the point “Deployment” I selected the “OpenMV Firmware” Deployment.

And then I followed the steps from the tutorial from above. I reset the nicla vision by doubleclicking the reset button. Then I connected it to OpenMV and flashed the new firmware on the board.

When I run the “ei_image_classification.py” the error occurs.

Thats all I did. I didn’t modify or specify anything further in my environment.

If you need a more specific information, let me know.

Thank you.

1 Like

Hi @gom9sgm

Thanks for clarifying, our embedded team has noted the bug and yes it is on our build side as you have observed.

The issue is to do with the size of the firmware including the impulse / model exceeds the device limits.

Our output from the build should have notified you of this and failed, but instead it allowed you to download and flash to device.

We will post here once the issue is resolved.

@mateusz fyi

Best

Eoin

Hi Eoin,

Thanks for this answer, I am having the same issue.
Is there any possibility to run this sketch directly as Arduino library? Will the nicla vision short of RAM/ROM?

Thanks,
Nianyu Jiang