tensorflow-yolov4-tflite
tensorflow-yolov4-tflite copied to clipboard
From scratch training model, can be converted to tflite?
Does anyone train a model on their own data, convert it to tflite format, and apply it to Android?
Haven't tried on Android. But I did transfer learning (started with pretrained weights but had custom dataset), converted to tflite (both regular and int8 (int8 required some hacks)), and ran on raspberry pi
The model format saved using model.save_weights() in train.py is ckpt, how to convert to tflite format?Does anyone know how to do it?
Try:
python convert_tflite.py --weights ./checkpoints/yolov4
And change the load function to:
model.load_weights(FLAGS.weights)
https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/68
Could you please show more about convert_tflite.py? I do not know how to transfer "converter = tf.lite.TFLiteConverter.from_saved_model(FLAGS.weights)" to "load_weights", thanks a lot.
tflite doesn't support load_weights. You have to use tf.lite.Interpreter
But I found interpreter could also not use load_weight. Could you please send me your convert_tflite.py that converts yolov4.data-00000-of-00001 to tflite? My email is [email protected]. Sorry for my anxiety because it's my homework and today is ddl.
Put the path of your model here. I used h5 format. It should work with file format too
https://github.com/sterlingrpi/ssd_tflite_tpu/blob/c693f0b506f18091787bea8b1c33a94936b00bb5/tflite_convert.py#L10
What class has you doing a custom trained SSD on a TPU?
NM. I thought you were asking about a different repo
like this? ssd = tf.keras.models.load_model('./checkpoints/yolov4.data-00000-of-00001') It requires {saved_model.pbtxt|saved_model.pb} but I only get .data-00000-of-00001
What class has you doing a custom trained SSD on a TPU?
Emmm I'm training Yolo4.
Put the path of your model here. I used h5 format. It should work with file format too
https://github.com/sterlingrpi/ssd_tflite_tpu/blob/c693f0b506f18091787bea8b1c33a94936b00bb5/tflite_convert.py#L10
It still doesn't work. It requires a .pdtxt or .pd file but I only have yolov4.data-00000-of-00001 instead.