Favicon of TensorFlow Model Optimization Toolkit

TensorFlow Model Optimization Toolkit

An open-source Python toolkit for optimizing TensorFlow and Keras models with quantization and pruning for cloud, mobile and edge deployment.

Screenshot of TensorFlow Model Optimization Toolkit website

TensorFlow Model Optimization Toolkit is an open-source Python library for developers preparing TensorFlow and Keras models for deployment on mobile, IoT and other edge devices, or in the cloud. It helps reduce inference latency and cost, and adapt models to limits on memory, processing power, energy use and storage.

The toolkit covers both post-training optimization of existing models and techniques applied during training. That gives developers a choice between working with a trained model and incorporating optimization into the training process. Its stable Python APIs include interfaces built specifically for Keras.

Quantization includes post-training integer quantization and quantization-aware training. Pruning produces sparse weights, while weight clustering provides another approach to model compression. The Collaborative Optimization API supports combining optimization techniques.

These capabilities matter when a model needs to fit a device's resource limits or execute efficiently on a target processor. The toolkit also supports optimization for existing hardware and special-purpose accelerators. It focuses on preparing models for deployment, with cloud and edge execution as target uses.

The project uses the Apache 2.0 license. Install tensorflow-model-optimization with pip and install a compatible TensorFlow version separately. Each technique has its own API compatibility matrix; do not assume compatibility with every TensorFlow or Keras release.

Similar to TensorFlow Model Optimization Toolkit