中文 | English
Documents:https://paddlepaddle.github.io/PaddleSlim
PaddleSlim is a toolkit for model compression. It contains a collection of compression strategies, such as pruning, fixed point quantization, knowledge distillation, hyperparameter searching and neural architecture search.
PaddleSlim provides solutions of compression on computer vision models, such as image classification, object detection and semantic segmentation. Meanwhile, PaddleSlim Keeps exploring advanced compression strategies for language model. Furthermore, benckmark of compression strategies on some open tasks is available for your reference.
PaddleSlim also provides auxiliary and primitive API for developer and researcher to survey, implement and apply the method in latest papers. PaddleSlim will support developer in ability of framework and technology consulting.
Naive knowledge distillation: transfers dark knowledge by merging the teacher and student model into the same Program
Paddle large-scale scalable knowledge distillation framework Pantheon: a universal solution for knowledge distillation, more flexible than the naive knowledge distillation, and easier to scale to the large-scale applications.
Requires:
Paddle >= 1.7.0
pip install paddleslim -i https://pypi.org/simple
If you want to use quantization in PaddleSlim, please install PaddleSlim as follows.
If you want to use quantized model in ARM and GPU, any PaddleSlim version is ok and you should install 1.2.0 for CPU.
pip install paddleslim==1.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install paddleslim==1.1.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install paddleslim==1.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
QuickStart: Introduce how to use PaddleSlim by simple examples.
Dynamic graph
Advanced Tutorials:Tutorials about advanced usage of PaddleSlim.
Model Zoo:Benchmark and pretrained models.
Algorithm Background: Introduce the background of quantization, pruning, distillation, NAS.
PaddleDetection: Introduce how to use PaddleSlim in PaddleDetection library.
PaddleSeg: Introduce how to use PaddleSlim in PaddleSeg library.
PaddleLite: How to use PaddleLite to deploy models generated by PaddleSlim.
TensorRT Deploy: How to use TensorRT to deploy models generated by PaddleSlim.
Dataset: ImageNet2012; Model: MobileNetV1;
Method | Accuracy(baseline: 70.91%) | Model Size(baseline: 17.0M) |
---|---|---|
Knowledge Distillation(ResNet50) | +1.06% | - |
Knowledge Distillation(ResNet50) + int8 quantization | +1.10% | -71.76% |
Pruning(FLOPs-50%) + int8 quantization | -1.71% | -86.47% |
Method | mAP(baseline: 76.2%) | Model Size(baseline: 94MB) |
---|---|---|
Knowledge Distillation(ResNet34-YOLOv3) | +2.8% | - |
Pruning(FLOPs -52.88%) | +1.4% | -67.76% |
Knowledge DistillationResNet34-YOLOv3)+Pruning(FLOPs-69.57%) | +2.6% | -67.00% |
Method | mAP(baseline: 29.3%) | Model Size |
---|---|---|
Knowledge Distillation(ResNet34-YOLOv3) | +2.1% | - |
Knowledge Distillation(ResNet34-YOLOv3)+Pruning(FLOPs-67.56%) | -0.3% | -66.90% |
Dataset: ImageNet2012; Model: MobileNetV2
Device | Infer time cost | Top1 accuracy(baseline:71.90%) |
---|---|---|
RK3288 | -23% | +0.07% |
Android cellphone | -20% | +0.16% |
iPhone 6s | -17% | +0.32% |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。