How to convert model.h5 to for OpenMV

I want to convert my images classification model (model.h5) from keras to .network type and deploy it to the OpenMV M7

(My model is used to classify A-Z, 0-9 on OpenMV)

What should I do?

thank you very much

Hi, I’m about to get tensorflow lite running on the OpenMV Cam. I’m aiming to get the PR done for this in the next 3 days or so. Once I do that you can take any tensor flow model and run it on the M7/H7. Tensorflow will only support depthwise convolutions and fully connected however. So, you want to use transfer learning from mobilenet.

thank you for your answer, I’m very excited to use it.

@kwagyeman, Is this the git you mean?

And if it’s yes, How can I use it? Do you have a example to use?

I’m almost done getting tensor flow working on the camera. The library is just for other folks wanting to use the code on their custom MCUs.

Anyway, I’m actively working on the library. I’ve gotten past most compile issues and should be getting it integrated into our firmware soon. I’ll have as a first demo mobilenet running on the OpenMV Cam.

Do u have any update?

Sorry, this has gotten bogged down.

The code has been pushed to a branch on my github fork here:

I was about to have mobilnet working. However, google’s default memory allocator uses up all of our RAM and is not efficient. It allocates very layer for the net in RAM instead of just the two layers its actually working on. As such, I don’t have a network to demo. So, I have to write a guide for how to train a tensor flow model. Anyway, I have not found time for this because the email load is quite every right now.

If you have a tflite network that’s been trained and quantizied I may be able to run it and debug my code however. That would help me. Since I’m just a wrapper around tensor flow and tensor flow is already verified I could get this released to everyone more quickly then. I’d need a network that does something obvious however.


I’ve tried to put together a tflite model for recognizing american sign language.
I’ve used the data from kagle here: ASL Alphabet | Kaggle

I’ve tried to do some transfer learning from mobilenet from imagenet weights. I just attached a few simple layers at the end and changed the number of categories.

My jupyter notebook: Dropbox - Error
The resulting tflite file: Dropbox - Error

It’s not particularly small, and when I xdd -i against it, the size grew considerably. I don’t know if that is normal.

I’m fairly new to all this. It would be great to get some hints on how to get the model on the cam =)

thanks for all your work ^^

Honestly, I really haven’t had time to deal with this. Me an Ibrahim are being hit by a bunch of stuff in the background. I was hoping Google would provide some more support but like normal we aren’t big enough to warrant when we email folks for action to quickly happen.

The next firmware release will have TF support however. We just finished shipping all the Kickstarter orders and getting the store stable so I can focus on development work again.

No worries. Do your thing and chime back when you have any news. Thanks again for all your effort!