experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 784 forks source link

How can I convert tflite model? #411

Open zmqp111 opened 5 years ago

zmqp111 commented 5 years ago

hi

I am going to convert Keras model into tflite model.

But, I have some problems.

  1. cannot use custom function.

    • In some cases, the CustomObjectScope function is applied, but not applied, as a result of experimenting with changing the version of keras and tensorflow.(Keras : 2.1.6, TF : 1.13.1 ===> can)
    • Cannot use custom_loss() in frontend.py
  2. What is input arrays and output arrays?

  3. How can I convert Keras model to tflite model?

thans

rodrigo2019 commented 5 years ago

1º save your model 2º create a second yolo model 3º load the weights from the saved model

in this way your model won't be compiled, so you don't need to set the custom loss