-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how convert to .tflite? #15
Comments
I have converted to TFLite file successfully in TF 2.3, but you cannot convert it under TF 2.3.
|
For me, it was not so straight forward. However, I was able to convert using custom_opdefs. But it is not easy to do the post training integer quantization. Have you tried this? I am talking about mobilenet backbone. |
Retinaface model using dynamic input shape, you should fix input shape to static before converting to TF Lite. |
@DavorJordacevic Could you please share your method for converting RetinaFace to tflite using custom_opdefs? Thanks. |
Hi @DavorJordacevic . Have you managed to deal with the integer quantization for tflite for retinaface? The tflite version gives the same results as the original pytorch model, but when I convert to a quantized integer (8bit) model, the results are messy. Even If I use the quantizing parameters to transform the output. Could you solve this? |
when using the following code:
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_types = [tf.float16]
tflite_model = converter.convert()
open("./tflite_models/face_retinaface_mobilenetv2.tflite", "wb").write(tflite_model)
print('saved tflite model!')
An error of "Tensor 'input_image' has invalid shape '[None, None, None, 3]."appears
How convert to .tflite?Looking forward to your reply.
The text was updated successfully, but these errors were encountered: