Conver TFRS to the tflite

Does anyone have any idea that how I can convert the output of the Tensorflow recommender system to tflite and use it in the web of flutter project?

Hi @Mohsen_Namazi

Have you seen the example here and there? After the procedure have you checked the conversion with this guide?

Is there an error during the conversion?

Also it seems that there is a solution with Model Maker

Hi, @George_Soloupis, thank you for the reply. I simply ran the retrieval code by Colab.
And added the recommended method to convert the final model to tflite. That was:

converter = tf.lite.TFLiteConverter.from_saved_model(path) # path to the SavedModel directory
tflite_model = converter.convert()

You can see the error in the following image.

OK I understand. I think the solution is to go with this option:

It seems that the python script files are good enough to give you the final .tflite file


Your model includes TF ops that are not covered by the TFLite builtin op set. Please consdier enabling the Select TF ops. Select TensorFlow operators  |  TensorFlow Lite

converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
converter.target_spec.supported_ops = [
  tf.lite.OpsSet.TFLITE_BUILTINS, # enable TensorFlow Lite ops.
  tf.lite.OpsSet.SELECT_TF_OPS # enable TensorFlow ops.
tflite_model = converter.convert()