1
votes

I am very new to machine learning. I have a python file with a very simple TensorFlow model that I need to deploy on Android using Google's ML Kit (which would be creating tflite file). I absolutely don't understand what should be the structure of my python file and Google's documentation doesn't make it any easier. Maybe someone has a good example of converting CUSTOM MODEL WRITTEN FROM SCRATCH and then using it in Java. I need to pass a string from Android's text field and get a predicted answer.

1
Can you provide more information about your model and the problem which you are facing? You may refer this and this. - Shubham Panchal
You need to create a .tflite file with tf.lite.TFLiteConverter API. - Shubham Panchal

1 Answers

0
votes

You need to first train your model on whatever the dataset you have. The layers in the model must comply with the supported layers by the TFLite library. Here is a list of layers that are supported and unsupported.

Once you have trained it, based on how you saved it (Let's say using kerasmodel.save). Convert it to TFLite following this tutorial or other tutorials on this page.

Now you can use this .tflite model in Android studio. For this you can follow this good tutorial.