Uanble to train a custom model using tflite model maker

I have created a custom neural network structure that I have changed to tflite. I want to train in using new data on device by using the ‘create’ functionality as follow:

converter = tf.lite.TFLiteConverter.from_keras_model(model) # using the custom structured ‘model’
lite_model = converter.convert() # converting to tflite format
new_model = lite_model.create(x_train[0:tr_samples], y_train[0:tr_samples]) #using ‘create’ function to retrain

However, when I run the above code, I get the following error:

AttributeError Traceback (most recent call last)
1 converter = tf.lite.TFLiteConverter.from_keras_model(model)
2 lite_model = converter.convert()
----> 3 new_model = lite_model.create(x_train[0:tr_samples], y_train[0:tr_samples])

AttributeError: ‘bytes’ object has no attribute ‘create’

Can anyone please explain how tackle this issue or how to retrain my own model (converted to tflite) again on a destination device (using python)

Hi @Suraj_Pandey, when you use converter.convert() the output will be the intermediate representation of the model in bytes which is useful to deploy the model on edge devices. This intermediate representation is not possible to create a new model. After converting your model to TensorFlow Lite and deploying it on edge , you can retrain the model on a device using new data and the train signature method of your model. Thank You.