{"id":13443268,"url":"https://github.com/PaddlePaddle/PaddleSlim","last_synced_at":"2025-03-20T16:30:59.132Z","repository":{"id":37396808,"uuid":"228290594","full_name":"PaddlePaddle/PaddleSlim","owner":"PaddlePaddle","description":"PaddleSlim is an open-source library for deep model compression and architecture search.","archived":false,"fork":false,"pushed_at":"2024-12-04T09:35:43.000Z","size":17142,"stargazers_count":1584,"open_issues_count":55,"forks_count":352,"subscribers_count":90,"default_branch":"develop","last_synced_at":"2025-03-20T16:09:13.359Z","etag":null,"topics":["bert","compression","detection","distillation","ernie","nas","pruning","quantization","segmentation","sparsity","tensorrt","transformer","yolov5","yolov6","yolov7"],"latest_commit_sha":null,"homepage":"https://paddleslim.readthedocs.io/zh_CN/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaddlePaddle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-16T02:56:50.000Z","updated_at":"2025-03-19T13:03:21.000Z","dependencies_parsed_at":"2024-01-03T13:46:33.242Z","dependency_job_id":"16c8e3f7-4277-4c94-850b-c2da2095096e","html_url":"https://github.com/PaddlePaddle/PaddleSlim","commit_stats":{"total_commits":1139,"total_committers":60,"mean_commits":"18.983333333333334","dds":0.8112379280070237,"last_synced_commit":"37cc8b3f9bcf3f55cd521abbe001eb354e0e1823"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddlePaddle%2FPaddleSlim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddlePaddle%2FPaddleSlim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddlePaddle%2FPaddleSlim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaddlePaddle%2FPaddleSlim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaddlePaddle","download_url":"https://codeload.github.com/PaddlePaddle/PaddleSlim/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244649796,"owners_count":20487493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bert","compression","detection","distillation","ernie","nas","pruning","quantization","segmentation","sparsity","tensorrt","transformer","yolov5","yolov6","yolov7"],"created_at":"2024-07-31T03:01:58.372Z","updated_at":"2025-03-20T16:30:59.104Z","avatar_url":"https://github.com/PaddlePaddle.png","language":"Python","readme":"\n\u003cp align=\"center\"\u003e\n\u003ch1 align=\"center\"\u003ePaddleSlim\u003c/h1\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache%202-dfd.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/PaddlePaddle/Paddle?color=ffa\"\u003e\u003c/a\u003e\n    \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.6.2+-aff.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-pink.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/graphs/contributors\"\u003e\u003cimg src=\"https://img.shields.io/github/contributors/PaddlePaddle/PaddleSlim?color=9ea\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/PaddleSlim/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/dm/PaddleSlim?color=9cf\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/PaddlePaddle/PaddleSlim?color=9cc\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/PaddlePaddle/PaddleSlim?color=ccf\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nPaddleSlim是一个专注于深度学习模型压缩的工具库，提供**低比特量化、知识蒸馏、稀疏化和模型结构搜索**等模型压缩策略，帮助开发者快速实现模型的小型化。\n\n## 产品动态\n\n- 🔥 2022.01.18: 发布[YOLOv8自动化压缩示例](https://github.com/PaddlePaddle/PaddleSlim/tree/develop/example/auto_compression/detection)，量化预测加速2.5倍。\n\n- **【直播分享】2022-12-13 20:30 《自动化压缩技术详解及ViT模型实战》，微信扫码报名**\n  \u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/54695910/216616669-21fcbcf3-60f3-44ca-938f-9c1fcb0af73f.jpg\"  width = \"180\" height = \"180\" /\u003e\n  \u003c/div\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e2022.08.16：自动化压缩功能升级\u003c/summary\u003e\n\n  - 支持直接加载ONNX模型和Paddle模型导出至ONNX\n  - 发布量化分析工具，发布[YOLO系列离线量化工具](example/post_training_quantization/pytorch_yolo_series)\n  - 更新[YOLO-Series自动化压缩模型库](example/auto_compression/pytorch_yolo_series)\n\n  | 模型  | Base mAP\u003csup\u003eval\u003cbr\u003e0.5:0.95 | ACT量化mAP\u003csup\u003eval\u003cbr\u003e0.5:0.95  | 模型体积压缩比 | 预测时延\u003csup\u003e\u003csmall\u003eFP32\u003c/small\u003e\u003csup\u003e\u003cbr\u003e\u003csup\u003e  | 预测时延\u003csup\u003e\u003csmall\u003eINT8\u003c/small\u003e\u003csup\u003e\u003cbr\u003e\u003csup\u003e | 预测加速比 |\n  | :-------- |:-------- |:--------: | :--------: | :---------------------: | :----------------: | :----------------: |\n  | PPYOLOE-s | 43.1 | 42.6  | 3.9倍  | 6.51ms  | 2.12ms  | 3.1倍 |\n  | YOLOv5s | 37.4   | 36.9  | 3.8倍  | 5.95ms  |  1.87ms | 3.2倍 |\n  | YOLOv6s | 42.4   | 41.3 | 3.9倍 |  9.06ms  |   1.83ms   | 5.0倍   |\n  | YOLOv7 |  51.1   | 50.9 | 3.9倍 |  26.84ms  |   4.55ms   |  5.9倍  |\n  | YOLOv7-Tiny | 37.3   | 37.0 | 3.9倍 | 5.06ms  |   1.68ms   |  3.0倍  |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e历史更新\u003c/summary\u003e\n\n- **2022.07.01: 发布[v2.3.0版本](https://github.com/PaddlePaddle/PaddleSlim/releases/tag/v2.3.0)**\n\n  - 发布[自动化压缩功能](example/auto_compression)\n    - 支持代码无感知压缩：开发者只需提供推理模型文件和数据，既可进行离线量化（PTQ）、量化训练（QAT）、稀疏训练等压缩任务。\n    - 支持自动策略选择，根据任务特点和部署环境特性：自动搜索合适的离线量化方法,自动搜索最佳的压缩策略组合方式。\n    - 发布[自然语言处理](example/auto_compression/nlp)、[图像语义分割](example/auto_compression/semantic_segmentation)、[图像目标检测](example/auto_compression/detection)三个方向的自动化压缩示例。\n    - 发布`X2Paddle`模型自动化压缩方案:[YOLOv5](example/auto_compression/pytorch_yolo_series)、[YOLOv6](example/auto_compression/pytorch_yolo_series)、[YOLOv7](example/auto_compression/pytorch_yolo_series)、[HuggingFace](example/auto_compression/pytorch_huggingface)、[MobileNet](example/auto_compression/tensorflow_mobilenet)。\n  - 升级量化功能\n    - 统一量化模型格式；离线量化支持while op；修复BERT大模型量化训练过慢的问题。\n    - 新增7种[离线量化方法](docs/zh_cn/tutorials/quant/Quantization_intro.md), 包括HIST, AVG, EMD, Bias Correction, AdaRound等。\n  - 支持半结构化稀疏训练\n  - 新增延时预估工具\n    - 支持对稀疏化模型、低比特量化模型的性能预估；支持预估指定模型在特定部署环境下 (ARM CPU + Paddle Lite) 的推理性能；提供 SD625、SD710、RK3288 芯片 + Paddle Lite 的预估接口。\n    - 提供部署环境自动扩展工具，可以自动增加在更多 ARM CPU 设备上的预估工具。\n\n- **2021.11.15: 发布v2.2.0版本**\n\n  - 支持动态图离线量化功能.\n\n- **2021.5.20: 发布V2.1.0版本**\n\n  - 扩展离线量化方法\n  - 新增非结构化稀疏\n  - 增强剪枝功能\n  - 修复OFA功能若干bug\n\n更多信息请参考：[release note](https://github.com/PaddlePaddle/PaddleSlim/releases)\n\n\u003c/details\u003e\n\n## 基础压缩功能概览\n\nPaddleSlim支持以下功能，也支持自定义量化、裁剪等功能。\n\u003ctable\u003e\n\u003ctr align=\"center\" valign=\"bottom\"\u003e\n  \u003cth\u003e\u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/docs/zh_cn/tutorials/quant/overview.md\"\u003eQuantization\u003c/a\u003e\u003c/th\u003e\n  \u003cth\u003e\u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/docs/zh_cn/tutorials/pruning/overview.md\"\u003ePruning\u003c/a\u003e\u003c/th\u003e\n  \u003cth\u003e\u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/docs/zh_cn/tutorials/nas/overview.md\"\u003eNAS\u003c/a\u003e\u003c/th\u003e\n  \u003cth\u003e\u003ca href=\"https://github.com/PaddlePaddle/PaddleSlim/tree/release/2.0.0/docs/zh_cn/tutorials\"\u003eDistilling\u003c/a\u003e\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr valign=\"top\"\u003e\n  \u003ctd\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#%E5%9C%A8%E7%BA%BF%E9%87%8F%E5%8C%96%E8%AE%AD%E7%BB%83qat\"\u003eQAT\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#pact\"\u003ePACT\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#%E9%9D%99%E6%80%81%E7%A6%BB%E7%BA%BF%E9%87%8F%E5%8C%96ptq-static\"\u003ePTQ Static\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#%E5%8A%A8%E6%80%81%E7%A6%BB%E7%BA%BF%E9%87%8F%E5%8C%96ptq-dynamic\"\u003ePTQ Dynamic\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#embedding%E9%87%8F%E5%8C%96\"\u003eEmbedding Quant\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/td\u003e\n  \u003ctd\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#%E6%95%8F%E6%84%9F%E5%BA%A6%E5%89%AA%E6%9E%9D\"\u003eSensitivityPruner\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#fpgm\"\u003eFPGMFilterPruner\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#l1norm\"\u003eL1NormFilterPruner\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#l2norm\"\u003e**L2NormFilterPruner\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#slimfilter\"\u003e*SlimFilterPruner\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#optslimfilter\"\u003e*OptSlimFilterPruner\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/td\u003e\n  \u003ctd\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#sanas\"\u003e*Simulate Anneal based NAS\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#rlnas\"\u003e*Reinforcement Learning based NAS\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#darts\"\u003e**DARTS\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#pc-darts\"\u003e**PC-DARTS\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#once-for-all\"\u003e**Once-for-All\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#hardware-aware-search\"\u003e*Hardware-aware Search\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/td\u003e\n\n  \u003ctd\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#fsp\"\u003e*FSP\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#dml\"\u003e*DML\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"docs/zh_cn/api_cn/overview.md#dk\"\u003e*DK\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n注：\n- *表示仅支持静态图，**表示仅支持动态图\n- 敏感度裁剪指的是通过各个层的敏感度分析来确定各个卷积层的剪裁率，需要和其他裁剪方法配合使用。\n\nPaddleSlim在典型视觉和自然语言处理任务上做了模型压缩，并且测试了Nvidia GPU、ARM等设备上的加速情况，这里展示部分模型的压缩效果，详细方案可以参考下面CV和NLP模型压缩方案:\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/images/benchmark.png\" height=185 width=849 hspace='10'/\u003e \u003cbr /\u003e\n\u003cstrong\u003e表1: 部分场景模型压缩加速情况\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e注意事项\u003c/summary\u003e\n\n- YOLOv3: 在移动端SD855上加速3.55倍。\n- PP-OCR: 体积由8.9M减少到2.9M, 在SD855上加速1.27倍。\n- BERT: 模型参数由110M减少到80M，精度提升的情况下，Tesla T4 GPU FP16计算加速1.47倍。\n\u003c/details\u003e\n\n### 不同压缩方法效果\n\u003cdetails\u003e\n\u003csummary\u003e自动压缩效果\u003c/summary\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"800\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7534971/168805367-f9d1299d-93e3-44d0-84da-870217edeb54.png\"/\u003e \u003cbr /\u003e\n\u003cstrong\u003e表3: 自动压缩效果\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e离线量化效果对比\u003c/summary\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg width=\"750\" alt=\"image\" src=\"https://user-images.githubusercontent.com/7534971/169042883-9ca281ce-19be-4525-a3d2-c54cea4a2cbd.png\"/\u003e \u003cbr /\u003e\n\u003cstrong\u003e表2: 多种离线量化方法效果对比\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003c/details\u003e\n\n## 安装\n\n安装发布版本：\n```bash\npip install paddleslim\n```\n\n安装develop版本：\n```bash\ngit clone https://github.com/PaddlePaddle/PaddleSlim.git \u0026 cd PaddleSlim\npython setup.py install\n```\n\n- 验证安装：安装完成后您可以使用 python 或 python3 进入 python 解释器，输入import paddleslim, 没有报错则说明安装成功。\n- 版本对齐：\n\n|  PaddleSlim   | PaddlePaddle   | PaddleLite    |\n| :-----------: | :------------: | :------------:|\n| 2.0.0         | 2.0            |       2.8     |\n| 2.1.0         | 2.1.0          |       2.8     |\n| 2.1.1         | 2.1.1          |       \u003e=2.8   |\n| 2.3.0         | 2.3.0          |       \u003e=2.11  |\n| 2.4.0         | 2.4.0          |       \u003e=2.11  |\n| develop       | develop        |       \u003e=2.11  |\n\n## 文档教程\n\n### 模型压缩技术\n- [模型量化技术](docs/zh_cn/tutorials/quant/Quantization_intro.md)\n\n### 快速开始\n\n- 🔥 [自动压缩](example/auto_compression)\n- [量化训练](docs/zh_cn/quick_start/static/quant_aware_tutorial.md)\n- [离线量化](docs/zh_cn/quick_start/static/quant_post_static_tutorial.md)\n- [结构化剪枝](docs/zh_cn/quick_start/static/pruning_tutorial.md)\n- [蒸馏](docs/zh_cn/quick_start/static/distillation_tutorial.md)\n- [NAS](docs/zh_cn/quick_start/static/nas_tutorial.md)\n- [量化分析工具](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/zh_cn/tutorials/quant/AnalysisPTQ.md)\n\n### 更多教程\n\n进阶教程详细介绍了每一步的流程，帮助您把相应方法迁移到您自己的模型上。\n\n- 通道剪裁\n  - [四种剪裁策略效果对比与应用方法](docs/zh_cn/tutorials/pruning/overview.md)\n    - [L1NormFilterPruner](docs/zh_cn/tutorials/pruning/overview.md#l1normfilterpruner)\n    - [FPGMFilterPruner](docs/zh_cn/tutorials/pruning/overview.md#fpgmfilterpruner)\n    - [SlimFilterFilterPruner](docs/zh_cn/tutorials/pruning/overview.md#slimfilterpruner)\n    - [OptSlimFilterPruner](docs/zh_cn/tutorials/pruning/overview.md#optslimfilterpruner)\n  - 自定义剪裁策略：[动态图](docs/zh_cn/tutorials/pruning/dygraph/self_defined_filter_pruning.md)\n\n- 低比特量化\n  - [三种量化方法介绍与应用](docs/zh_cn/tutorials/quant/overview.md)\n    - [量化训练](docs/zh_cn/quick_start/static/quant_aware_tutorial.md)\n    - [离线量化](docs/zh_cn/tutorials/quant/static/quant_post_tutorial.md) | [离线量化方法解析](docs/zh_cn/tutorials/quant/post_training_quantization.md)\n    - [embedding量化](docs/zh_cn/tutorials/quant/static/embedding_quant_tutorial.md)\n\n- NAS\n  - [四种NAS策略介绍和应用](docs/zh_cn/tutorials/nas/overview.md)\n    - [Once-For-All](docs/zh_cn/tutorials/nas/dygraph/nas_ofa.md)\n    - [SANAS](docs/zh_cn/tutorials/nas/static/sanas_darts_space.md)\n    - [RLNAS](https://github.com/PaddlePaddle/PaddleSlim/tree/release/2.0.0/demo/nas#rlnas%E7%BD%91%E7%BB%9C%E7%BB%93%E6%9E%84%E6%90%9C%E7%B4%A2%E7%A4%BA%E4%BE%8B)\n    - [DARTS](demo/darts/README.md)\n\n- 蒸馏\n  - [知识蒸馏示例](demo/distillation)\n\n\n### 推理部署\n- [Benchmark](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/docs/zh_cn/QUANT_BENCHMARK.md)\n- 量化部署支持的预测库：\n    - Paddle Inference：[GPU量化部署](demo/quant/deploy/TensorRT/README.md)、Intel CPU量化部署。\n    - Paddle Lite：[量化部署](docs/zh_cn/deploy/deploy_cls_model_on_mobile_device.md)\n    - ONNX\n\n## CV模型压缩\n### 多场景效果展示\n\n本系列教程均基于Paddle官方的模型套件中模型进行压缩，若您不是模型套件用户，更推荐使用快速教程和进阶教程。\n\n- 检测模型压缩\n  - 压缩方案\n    - [PPDetection-YOLOv3 压缩方案](docs/zh_cn/cv/detection/static/yolov3_slim.md)\n\n  - 方法应用-静态图\n    - [蒸馏](docs/zh_cn/cv/detection/static/paddledetection_slim_distillation_tutorial.md)\n    - [量化训练](docs/zh_cn/cv/detection/static/paddledetection_slim_quantization_tutorial.md)\n    - [模型结构搜索](docs/zh_cn/cv/detection/static/paddledetection_slim_nas_tutorial.md)\n    - [剪枝](docs/zh_cn/cv/detection/static/paddledetection_slim_pruing_tutorial.md)\n    - [剪枝与蒸馏的结合使用](docs/zh_cn/cv/detection/static/paddledetection_slim_prune_dist_tutorial.md)\n    - [卷积层敏感度分析](docs/zh_cn/cv/detection/static/paddledetection_slim_sensitivy_tutorial.md)\n\n  - 方法应用-动态图\n    - [剪枝](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.0-rc/dygraph/configs/slim#%E5%89%AA%E8%A3%81)\n    - [量化训练](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.0-rc/dygraph/configs/slim#%E9%87%8F%E5%8C%96)\n\n- 分割模型压缩\n\n  - 压缩方案\n\n  - 方法应用-静态图\n    - [蒸馏](https://github.com/PaddlePaddle/PaddleSeg/tree/release/v0.8.0/slim/distillation)\n    - [量化训练](https://github.com/PaddlePaddle/PaddleSeg/tree/release/v0.8.0/slim/quantization)\n    - [模型结构搜索](https://github.com/PaddlePaddle/PaddleSeg/tree/release/v0.8.0/slim/nas)\n    - [剪枝](https://github.com/PaddlePaddle/PaddleSeg/tree/release/v0.8.0/slim/prune)\n\n  - 方法应用-动态图\n    - [剪枝](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/slim#%E6%A8%A1%E5%9E%8B%E8%A3%81%E5%89%AA)\n    - [量化训练](https://github.com/PaddlePaddle/PaddleSeg/tree/develop/slim#%E6%A8%A1%E5%9E%8B%E9%87%8F%E5%8C%96)\n\n- OCR模型压缩\n\n  - 压缩方案\n    - [3.5M模型压缩方案](docs/zh_cn/cv/ocr/static/3.5M_slim.md)\n\n  - 方法应用-静态图\n    - [量化训练](https://github.com/PaddlePaddle/PaddleOCR/tree/release/1.1/deploy/slim/quantization)\n    - [剪枝](https://github.com/PaddlePaddle/PaddleOCR/tree/release/1.1/deploy/slim/prune)\n\n  - 方法应用-动态图\n    - [剪枝](https://github.com/PaddlePaddle/PaddleOCR/tree/develop/deploy/slim/prune)\n    - [量化训练](https://github.com/PaddlePaddle/PaddleOCR/tree/develop/deploy/slim/quantization)\n\n\n### NLP模型压缩\n\n- [PaddleNLP-BERT](docs/zh_cn/nlp/paddlenlp_slim_ofa_tutorial.md)\n- [ERNIE-ERNIE](docs/zh_cn/nlp/ernie_slim_ofa_tutorial.md)\n\n### API文档\n\n- [动态图](docs/zh_cn/api_cn/dygraph)\n- [静态图](docs/zh_cn/api_cn/static)\n\n### [FAQ](docs/zh_cn/FAQ/quantization_FAQ.md)\n\n#### 1. 量化训练或者离线量化后的模型体积为什么没有变小？\n答：这是因为量化后保存的参数是虽然是int8范围，但是类型是float。这是因为Paddle训练前向默认的Kernel不支持INT8 Kernel实现，只有Paddle Inference TensorRT的推理才支持量化推理加速。为了方便量化后验证量化精度，使用Paddle训练前向能加载此模型，默认保存的Float32类型权重，体积没有发生变换。\n\n\n#### 2. macOS + Python3.9环境或者Windows环境下, 安装出错, \"command 'swig' failed\"\n\n答: 请参考https://github.com/PaddlePaddle/PaddleSlim/issues/1258\n\n## 许可证书\n\n本项目的发布受[Apache 2.0 license](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/LICENSE)许可认证。\n\n## 贡献代码\n\n我们非常欢迎你可以为PaddleSlim提供代码，也十分感谢你的反馈。\n\n## \u003cimg title=\"\" src=\"https://user-images.githubusercontent.com/48054808/157800467-2a9946ad-30d1-49a9-b9db-ba33413d9c90.png\" alt=\"\" width=\"20\"\u003e 技术交流\n\n- 如果你发现任何PaddleSlim存在的问题或者是建议, 欢迎通过[GitHub Issues](https://github.com/PaddlePaddle/PaddleSlim/issues)给我们提issues。\n\n- 欢迎加入PaddleSlim 微信技术交流群\n\n \u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/54695910/216616669-21fcbcf3-60f3-44ca-938f-9c1fcb0af73f.jpg\"  width = \"225\" height = \"225\" /\u003e\n  \u003c/div\u003e\n","funding_links":[],"categories":["Python","神经网络结构搜索_Neural_Architecture_Search","Lighter and Deployment Frameworks"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaddlePaddle%2FPaddleSlim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPaddlePaddle%2FPaddleSlim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaddlePaddle%2FPaddleSlim/lists"}