TFLITE_Converter

src.TFLITE_Converter.convert_to_tflite(keras_model, generation=0, i=0, time=0)[source]

Convert a TensorFlow Keras model to TensorFlow Lite format and save it to a file. This function also applies optimization and quantization to the model during the conversion process.

Parameters:

keras_modelkeras.Model

The TensorFlow Keras model to be converted.

generationint, optional

The generation number of the model, used in the filename of the saved file.

iint, optional

An index used in the filename of the saved file.

timedatetime or str, optional

A timestamp used in the filename of the saved file.

Returns:

tflite_model, pathtuple

A tuple containing the converted TensorFlow Lite model and the path of the saved file.