Giter VIP home page Giter VIP logo

paddleslim's Introduction

PaddleSlim

中文 | English

Documentation Status Documentation Status License

PaddleSlim是一个模型压缩工具库,包含模型剪裁、定点量化、知识蒸馏、超参搜索和模型结构搜索等一系列模型压缩策略。

对于业务用户,PaddleSlim提供完整的模型压缩解决方案,可用于图像分类、检测、分割等各种类型的视觉场景。 同时也在持续探索NLP领域模型的压缩方案。另外,PaddleSlim提供且在不断完善各种压缩策略在经典开源任务的benchmark, 以便业务用户参考。

对于模型压缩算法研究者或开发者,PaddleSlim提供各种压缩策略的底层辅助接口,方便用户复现、调研和使用最新论文方法。 PaddleSlim会从底层能力、技术咨询合作和业务场景等角度支持开发者进行模型压缩策略相关的创新工作。

功能

功能模块 算法 教程与文档
剪裁
量化
蒸馏
模型结构搜索(NAS)

安装

pip install paddleslim -i https://pypi.tuna.tsinghua.edu.cn/simple

量化和Paddle版本的对应关系

如果在ARM和GPU上预测,每个版本都可以,如果在CPU上预测,请选择Paddle 2.0对应的PaddleSlim 1.2.0版本

  • Paddle 1.7 系列版本,需要安装PaddleSlim 1.0.1版本
pip install paddleslim==1.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
  • Paddle 1.8 系列版本,需要安装PaddleSlim 1.1.1版本
pip install paddleslim==1.1.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
  • Paddle 2.0 系列版本,需要安装PaddleSlim 1.2.0版本
pip install paddleslim==1.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

使用

部分压缩策略效果

分类模型

数据: ImageNet2012; 模型: MobileNetV1;

压缩策略 精度收益(baseline: 70.91%) 模型大小(baseline: 17.0M)
知识蒸馏(ResNet50) +1.06% -
知识蒸馏(ResNet50) + int8量化训练 +1.10% -71.76%
剪裁(FLOPs-50%) + int8量化训练 -1.71% -86.47%

图像检测模型

数据:Pascal VOC;模型:MobileNet-V1-YOLOv3

压缩方法 mAP(baseline: 76.2%) 模型大小(baseline: 94MB)
知识蒸馏(ResNet34-YOLOv3) +2.8% -
剪裁 FLOPs -52.88% +1.4% -67.76%
知识蒸馏(ResNet34-YOLOv3)+剪裁(FLOPs-69.57%) +2.6% -67.00%

数据:COCO;模型:MobileNet-V1-YOLOv3

压缩方法 mAP(baseline: 29.3%) 模型大小
知识蒸馏(ResNet34-YOLOv3) +2.1% -
知识蒸馏(ResNet34-YOLOv3)+剪裁(FLOPs-67.56%) -0.3% -66.90%

搜索

数据:ImageNet2012; 模型:MobileNetV2

硬件环境 推理耗时 Top1准确率(baseline:71.90%)
RK3288 -23% +0.07%
Android cellphone -20% +0.16%
iPhone 6s -17% +0.32%

许可证书

本项目的发布受Apache 2.0 license许可认证。

如何贡献代码

我们非常欢迎你可以为PaddleSlim提供代码,也十分感谢你的反馈。

paddleslim's People

Contributors

wanghaoshuang avatar ceci3 avatar baiyfbupt avatar slf12 avatar itminner avatar yukavio avatar xiteng1988 avatar qingqing01 avatar lijianshe02 avatar juncaipeng avatar heavengate avatar faninsm avatar lidanqing-intel avatar lielinjiang avatar mmglove avatar huangxu96 avatar parap1uie-s avatar vincentxiyu avatar zhuguiqian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.