tensorflow/lite/g3doc/api_docs/python/tflite_model_maker.md
page_type: reference description: Public APIs for TFLite Model Maker, a transfer learning library to train custom TFLite models.
<link rel="stylesheet" href="/site-assets/css/style.css"> <!-- DO NOT EDIT! Automatically generated file. --> <div itemscope itemtype="http://developers.google.com/ReferenceObject"> <meta itemprop="name" content="tflite_model_maker" /> <meta itemprop="path" content="Stable" /> <meta itemprop="property" content="__version__"/> </div>View source on GitHub
Public APIs for TFLite Model Maker, a transfer learning library to train custom TFLite models.
You can install the package with
pip install tflite-model-maker
Typical usage of Model Maker is to create a model in a few lines of code, e.g.:
# Load input data specific to an on-device ML app.
data = DataLoader.from_folder('flower_photos/')
train_data, test_data = data.split(0.9)
# Customize the TensorFlow model.
model = image_classifier.create(train_data)
# Evaluate the model.
accuracy = model.evaluate(test_data)
# Export to Tensorflow Lite model and label file in `export_dir`.
model.export(export_dir='/tmp/')
For more details, please refer to our guide: <a href="https://www.tensorflow.org/lite/guide/model_maker">https://www.tensorflow.org/lite/guide/model_maker</a>
audio_classifier module: APIs to train an audio classification model.
config module: APIs for the config of TFLite Model Maker.
image_classifier module: APIs to train an image classification model.
model_spec module: APIs for the model spec of TFLite Model Maker.
object_detector module: APIs to train an object detection model.
question_answer module: APIs to train a model that can answer questions based on a predefined text.
recommendation module: APIs to train an on-device recommendation model.
searcher module: APIs to create the searcher model.
text_classifier module: APIs to train a text classification model.