# H7 Camera Board - tf.load

**URL:** <https://forums.openmv.io/t/h7-camera-board-tf-load/6749>\
**Category:** OpenMV Boards\
**Created:** [January 19, 2022, 12:14pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749 "2022-01-19T12:14:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emboo](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Emboo](https://forums.openmv.io/u/Emboo)\
**Post date:** [January 19, 2022, 12:14pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749/1 "2022-01-19T12:14:30Z")

</div>

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:

```auto
import sensor, image, time, os, tf

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time=2000)

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

```

Serial Terminal output:

```auto
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!

---

<div class="post-metadata">

**Author:** ![jlutzwpi](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jlutzwpi](https://forums.openmv.io/u/jlutzwpi)\
**Post date:** [January 19, 2022, 4:41pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749/2 "2022-01-19T16:41:20Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [January 19, 2022, 7:00pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749/3 "2022-01-19T19:00:11Z")

</div>

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.

> **[GitHub - edgeimpulse/tensorflow at 791dc47439f01bc89431e8d3a5b0b63b1f8226d0](https://github.com/edgeimpulse/tensorflow/tree/791dc47439f01bc89431e8d3a5b0b63b1f8226d0)**
>
> 791dc47439f01bc89431e8d3a5b0b63b1f8226d0

We’re I think this tag:

> **[GitHub - edgeimpulse/tensorflow at ei-v2.5.0](https://github.com/edgeimpulse/tensorflow/tree/ei-v2.5.0)**
>
> ei-v2.5.0

…

So, maybe we need to update to:

> **[GitHub - edgeimpulse/tensorflow at ei-v2.5.0-2.7-compat](https://github.com/edgeimpulse/tensorflow/tree/ei-v2.5.0-2.7-compat)**
>
> ei-v2.5.0-2.7-compat

---

<div class="post-metadata">

**Author:** ![Emboo](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Emboo](https://forums.openmv.io/u/Emboo)\
**Post date:** [January 19, 2022, 8:47pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749/4 "2022-01-19T20:47:02Z")

</div>

Thanks for the quick reply.  
Well, the model is created in the Google Colab platform.  
Thing is, I followed the [openmv.io](http://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?

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [January 19, 2022, 9:14pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749/5 "2022-01-19T21:14:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Emboo](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Emboo](https://forums.openmv.io/u/Emboo)\
**Post date:** [January 19, 2022, 9:51pm UTC](https://forums.openmv.io/t/h7-camera-board-tf-load/6749/6 "2022-01-19T21:51:02Z")

</div>

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!
