Registry / ai-ml / tflite-model-maker-nightly

tflite-model-maker-nightly

JSON →
library0.4.4.dev202402230613pypypiunverified

Nightly build of TFLite Model Maker, a library to customize TensorFlow Lite models for on-device ML tasks (image classification, object detection, text classification, etc.). Current version 0.4.4.dev202402230613. Released nightly from TensorFlow Examples repository.

pip install tflite-model-maker-nightly
INSTALL
IMPORT
SIG · TFLITE-MODEL-MAKER
T
tflite-model-maker-nightly
ai-mlpythonv0.4.4.dev202402230613
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ImageClassifierDataLoader
✓ from tflite_model_maker import ImageClassifierDataLoader
✗ from tflite_model_maker.image_classifier import DataLoader
Older API used submodule; now import from top-level.
model_spec
✓ from tflite_model_maker import model_spec
✗ from tflite_model_maker.image_classifier import model_spec
model_spec is now in top-level module.
ImageClassifier
✓ from tflite_model_maker import ImageClassifier
✗ from tflite_model_maker.image_classifier import ImageClassifier
Direct import from top-level is preferred.

Train an image classifier with TFLite Model Maker nightly on a local folder of images.

import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TF warnings from tflite_model_maker import ImageClassifierDataLoader, ImageClassifier from tflite_model_maker import model_spec # Load data (example using flower_photos) data = ImageClassifierDataLoader.from_folder('flower_photos') train_data, test_data = data.split(0.8) # Choose model spec spec = model_spec.get('efficientnet_lite0') # Train model = ImageClassifier.create(train_data, model_spec=spec, epochs=5) # Evaluate loss, accuracy = model.evaluate(test_data) print(f'Accuracy: {accuracy}') # Export TFLite model.export(export_dir='.', tflite_filename='model.tflite')
Debug
Known issues
breakingNightly versions may have breaking changes. Pin to a specific version in production.
fix
Use a stable release like tflite-model-maker (non-nightly).
affects: All nightly builds
gotchaRequires TensorFlow 2.x. Incompatible with TensorFlow 1.x.
fix
Ensure TensorFlow >=2.4 is installed.
affects: All
gotchaOn macOS with Apple Silicon, some ops may fall back to CPU. Use TensorFlow >=2.5 for M1 support.
fix
Install tensorflow-macos and tensorflow-metal for acceleration.
affects: All
Upgrade
Version history
0.4.4.dev202402230613latest on PyPI · released Feb 23, 2024
Audit
Dependencies
tensorflowrequiredCore dependency; TFLite Model Maker requires TensorFlow.
tensorflow-model-optimizationoptionalFor quantization-aware training and post-training quantization.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources