M.Akyuzlu
M.Akyuzlu

Reputation: 335

Convert custom yolo weights to tflite?

I have trained some custom dataset on yolov4 using darknet tiny cfg.

Now I have three files:

classes.names  
yolov4-tiny-custom.cfg
yolov4-tiny-custom.weights

In order to implement yolo object detection to flutter apps I need to convert these files to:

 .tflite and .txt 

My total classes numbers are 54

How can I convert them?

Upvotes: 1

Views: 4564

Answers (1)

B200011011
B200011011

Reputation: 4258

You can go from yolo darknet weights to savedmodel pb to tflite. Once you have savedmodel generated then use TFLiteConverter to convert to tflite,

https://www.tensorflow.org/lite/convert

I have deployed custom yolov4 tiny model to android with repo below. It may help in your case.

https://github.com/hunglc007/tensorflow-yolov4-tflite

This repo was not updated in some time. Has coco.names hardcoded so instead modify the config.py code to include your classes.names. This is the related issue to fix the problem,

cannot reshape array of size 1665179 into shape (512,512,3,3)

Upvotes: 2

Related Questions