[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-07 UTC."],[],[],null,["# mediapipe_model_maker.model_util.convert_to_tflite_from_file\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/google/mediapipe/blob/master/mediapipe/model_maker/python/core/utils/model_util.py#L125-L159) |\n\nConverts the input Keras model to TFLite format.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`mediapipe_model_maker.face_stylizer.face_stylizer.face_stylizer_options.model_opt.loss_functions.model_util.convert_to_tflite_from_file`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/convert_to_tflite_from_file), [`mediapipe_model_maker.face_stylizer.face_stylizer.loss_functions.model_util.convert_to_tflite_from_file`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/convert_to_tflite_from_file), [`mediapipe_model_maker.face_stylizer.face_stylizer.model_opt.loss_functions.model_util.convert_to_tflite_from_file`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/convert_to_tflite_from_file), [`mediapipe_model_maker.face_stylizer.face_stylizer.model_util.convert_to_tflite_from_file`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/convert_to_tflite_from_file), [`mediapipe_model_maker.face_stylizer.face_stylizer_options.model_opt.loss_functions.model_util.convert_to_tflite_from_file`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/convert_to_tflite_from_file), [`mediapipe_model_maker.face_stylizer.model_options.loss_functions.model_util.convert_to_tflite_from_file`](https://www.tensorflow.org/mediapipe/api/solutions/python/mediapipe_model_maker/model_util/convert_to_tflite_from_file)\n\n\u003cbr /\u003e\n\n mediapipe_model_maker.model_util.convert_to_tflite_from_file(\n saved_model_file: str,\n quantization_config: Optional[../../mediapipe_model_maker/quantization/QuantizationConfig] = None,\n supported_ops: Tuple[tf.lite.OpsSet, ...] = (tf.lite.OpsSet.TFLITE_BUILTINS,),\n preprocess: Optional[Callable[..., Any]] = None,\n allow_custom_ops: bool = False\n ) -\u003e bytearray\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `saved_model_file` | Keras model to be converted to TFLite. |\n| `quantization_config` | Configuration for post-training quantization. |\n| `supported_ops` | A list of supported ops in the converted TFLite file. |\n| `preprocess` | A callable to preprocess the representative dataset for quantization. The callable takes three arguments in order: feature, label, and is_training. |\n| `allow_custom_ops` | A boolean flag to enable custom ops in model convsion. Default to False. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| bytearray of TFLite model ||\n\n\u003cbr /\u003e"]]