Running Edge Impulse OpenMV Library export on OpenMV N6

Issue:

I trained an image classification model on Edge Impulse and wanted to deploy it on the OpenMV N6 using the OpenMV Library export format from Edge Impulse. I used the below steps for that:

  1. Trained and validated a model on Edge Impulse
  2. Exported using Deployment → OpenMV Library in Edge Impulse — downloaded the .zip containing the .tflite model file and the ei_library Python bindings
  3. Copied the .tflite file to the N6’s PYBFLASH storage
  4. Attempted to load it using:
        import ml
        model = ml.Model("my_model.tflite")

Error received:

RuntimeError: Failed to load network

Device: OpenMV N6 (STM32N657X0, Neural-ART NPU)

IDE Version: OpenMV IDE 4.8.9

Firmware: v4.8.1

I also tried Edge Impulse Firmware deployment option but found that there is no supported option for the OpenMV N6 in that.

Is there a supported path to run an Edge Impulse OpenMV Library export on the OpenMV N6? Or is there a different loading method for standard TFLite on the N6?

Thanks

Swathi

Hi, you need to run it through the ROMFS feature and copy the model onto the system.

Please note that you need to update the firmware on the N6 to the latest firmware via Tools->Install Latest Dev Release. Make sure to select the Update ROMFS Button.

Once you update the firmware on the N6, then, via Tools->Edit ROMFS. Once that dialog appears. Click add file, and add the model file via that. It will be converted to run onboard. Then commit the ROMFS back to the camera.

You can then run the model via openmv/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_object_detection.py at master · openmv/openmv · GitHub

On the N6 or AE3, all models must be run from the ROMFS and be converted by the NPU conversion tools.