PocketFlow logo

PocketFlow

Tencent/PocketFlow

An Automatic Model Compression framework for developing smaller and faster AI applications

GraphCanon updated 3w · GitHub synced 3w · 26 views this month

2.9k stars491 forksLast push 3y Python Other

Decision brief

PocketFlow automates deep learning model compression to enhance inference efficiency with minimal human effort by selecting optimal hyper-parameters for model development focusing on mobile applications.

Good fit when

  • When you need to optimize TensorFlow models specifically for deployment on devices with limited computational resources like mobile phones
  • If you want automated selection of optimal hyper-parameters for compressing deep learning models without manual tuning

Avoid when

  • Avoid if your project does not require model compression and efficiency improvement for deployment
  • Do not use if the TensorFlow-centric tools are irrelevant to your project, as PocketFlow integrates closely with TensorFlow APIs

Observed Jul 17, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Dormant (1221d since push)
As of 3w
Provenance
Not a fork · Organization account
As of 3w
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install PocketFlow
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

PocketFlow is an open-source framework that automates deep learning model compression to improve inference efficiency with minimal human effort.

Capability facts

Languages
python

Source: github.language · Aug 4, 2026

Categories

Tags

README

PocketFlow

PocketFlow is an open-source framework for compressing and accelerating deep learning models with minimal human effort. Deep learning is widely used in various areas, such as computer vision, speech recognition, and natural language translation. However, deep learning models are often computational expensive, which limits further applications on mobile devices with limited computational resources.

PocketFlow aims at providing an easy-to-use toolkit for developers to improve the inference efficiency with little or no performance degradation. Developers only needs to specify the desired compression and/or acceleration ratios and then PocketFlow will automatically choose proper hyper-parameters to generate a highly efficient compressed model for deployment.

PocketFlow was originally developed by researchers and engineers working on machine learning team within Tencent AI Lab for the purposes of compacting deep neural networks with industrial applications.

For full documentation, please refer to PocketFlow's GitHub Pages. To start with, you may be interested in the installation guide and the tutorial on how to train a compressed model and deploy it on mobile devices.

For general discussions about PocketFlow development and directions please refer to PocketFlow Google Group. If you need a general help, please direct to Stack Overflow. You can report issues, bug reports, and feature requests on GitHub Issue Page.

News: we have created a QQ group (ID: 827277965) for technical discussions. Welcome to join us!

Framework

The proposed framework mainly consists of two categories of algorithm components, i.e. learners and hyper-parameter optimizers, as depicted in the figure below. Given an uncompressed original model, the learner module generates a candidate compressed model using some randomly chosen hyper-parameter combination. The candidate model's accuracy and computation efficiency is then evaluated and used by hyper-parameter optimizer module as the feedback signal to determine the next hyper-parameter combination to be explored by the learner module. After a few iterations, the best one of all the candidate models is output as the final compressed model.

Learners

A learner refers to some model compression algorithm augmented with several training techniques as shown in the figure above. Below is a list of model compression algorithms supported in PocketFlow:

NameDescription
ChannelPrunedLearnerchannel pruning with LASSO-based channel selection (He et al., 2017)
DisChnPrunedLearnerdiscrimination-aware channel pruning (Zhuang et al., 2018)
WeightSparseLearnerweight sparsification with dynamic pruning schedule (Zhu & Gupta, 2017)
UniformQuantLearnerweight quantization with uniform reconstruction levels (Jacob et al., 2018)
UniformQuantTFLearnerweight quantization with uniform reconstruction levels and TensorFlow APIs
NonUniformQuantLearnerweight quantization with non-uniform reconstruction levels (Han et al., 2016)

All the above model compression algorithms can trained with fast fine-tuning, which is to directly derive a compressed model from the original one by applying either pruning masks or quantization functions. The resulting model can be fine-tuned with a few iterations to recover the accuracy to some extent. Alternatively, the compressed model can be re-trained with the full training data, which leads to higher accuracy but usually takes longer to complete.

To further reduce the compressed model's performance degradation, we adopt network distillation to augment its training process with an

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.