H7 Camera Board - tf.load

Hi! I’m trying to load a tflite model on my H7 camera board. I’ve saved the ‘model.tflite’ on the USB drive. But when I run the following code, the camera runs a little, then disconnects and reconnects back (windows10 reopens the “newly” connected USB device.).

Board: H7
Sensor: MT9M114
Firmware version is 4.2.1-(latest)
, as stated by the OpenMV IDE.

This is the code:

import sensor, image, time, os, tf


net = tf.load("model.tflite")
print("model loaded.")

Serial Terminal output:

Traceback (most recent call last):
  File "main.py", line 13, in <module>
Exception: IDE interrupt
MicroPython: v1.17-omv-r15 OpenMV: v4.2.1 HAL: v1.9.0 BOARD: OPENMV4-STM32H743
Type "help()" for more information.

The model was created and trained on the Google Colab platform, using python library tensorflow 2.7.0.
Size of the model: ~87kB.
Please help me identify the problem(s). Thanks!

I’m seeing similar behavior with a model ~100kb in size, which I thought was well within the realm of executing on the H7 (not the plus). I changed around my model to be smaller and was able to get it to work…a model size of 87kb I think should be able to run…

In previous uses, if I was using a model that was too big, I would get a run-time error, not a reboot of the camera, so not sure what is going on…

Is this an Edge Impulse model or a Google created model? We updated the TensorFlow library to match Edge Impulses latest release. I can’t say if we are Google Colab compatible.

We’re I think this tag:

So, maybe we need to update to:

Thanks for the quick reply.
Well, the model is created in the Google Colab platform.
Thing is, I followed the openmv.io / docs and somehow I got into the Google Colab.
I don’t want this to sound rude, but just as a heads-up, I haven’t seen anything mentioned about EdgeImpulse in the docs.

So the only way around this is by using EdgeImpulse? No way using other frameworks?

I think it’s just that we are using a version that is not compatible with 2.7.0.

It should be possible to just switch the branch if edge impulses sdk and maybe we can fix it.

Regarding edge impulse… yeah… like, we’ve never talked about being compatible with that. If you can generate a 2.5.0 net then you should be fine.

I’ll have to update our firmware otherwise.

Yeah, I’ve seen more forum posts about/with EdgeImpulse, and also on digikey (quick start etc.). And they say they are compatible with H7P. So it seems like an OK way to do the thing. And that’s why I’ve said I never seen it in the docs, though it should be IMO.
Buut, thanks for the possible solution, I’ll try generating a 2.5.0 net with Google Colab, just to see if the tf version was the problem. And after I’ll try using EdgeImpulse, but for that, I have to convert 350 BMPs in JPGs or PNGs or w/e, first.
I’ll come back with the results, should be someone out there interested.

Thanks, Kwabena. Really appreciate your efforts and support!