Problem on creating and saving tflite model


I am trying to make a tflite model using a tf.module with modified model inside of it for inference, however I encounter an error that the model doesn’t have call argument. but when I saved the original model as tflite, it works just fine.

here the notebook in kaggle looks like notebook

any help would be appreciated thank you

Hi @Gibran_Alfil, Could you please try with the below given code and let us know if the issue gets resolved or not.

def saves () :
    # Create Model Converter
    keras_model_converter = tf.lite.TFLiteConverter.from_keras_model(tflite_keras_model)
    #Added this code line
    keras_model_converter.converter.experimental_new_converter = True

# Convert Model
    tflite_model = keras_model_converter.convert()  
    with open('/kaggle/working/model2.tflite', 'wb') as f:

Thank You.

Update :
i fixed it by naming all the layer inside each part (decoder, embedding, etc). How I found it is by trying to convert each part into tflite. the only working part is the classifier. And its not just conversion either, saving it normally using throw bad argument type for built in operation. Should i report this as a bug?