Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • models
  • 合并请求
  • !1458

M
models
  • 项目概览

PaddlePaddle / models
大约 2 年 前同步成功

通知 232
Star 6828
Fork 2962
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 602
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 255
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
M
models
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 602
    • Issue 602
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 255
    • 合并请求 255
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板

Add the calibration tool and document for int8 inference on Paddle !1458

  • Report abuse
!1458 已关闭 11月 16, 2018 由 saxon_zh@saxon_zh 创建
#<User:0x00007f0efe0ca648>
  • 概览 30
  • 提交 1
  • 变更 5

Created by: guomingz

We developed the calibration tool for int8 inference. Here is the document for this tool.

Introduction of Accuracy Calibration Tool for 8 Bit Inference

The 8-bits (INT8) inference is also known as the Low Precision Inference which could speed up the inference with the lower accuracy loss. It has higher throughput and lower memory requirements compared to FP32. As the PaddlePaddle enables the INT8 inference supporting, we release a accuracy tool(Calibration.py) at the same time. This tool will generate the quantization parameters and quantized model file finally.

Usage

  1. Build the PaddlePaddle with MKLDNN supporting.
  2. cd /path/to/the/model/fluid/PaddleCV/image_classification
  3. export FLAGS_use_mkldnn=True
  4. Run the command python calibration.py --model=MobileNet --batch_size=50 --class_dim=1000 --image_shape=3,224,224 --with_mem_opt=True --use_gpu=False --pretrained_model=weights/mobilenet --out=quantized_out --algo=KL It will generate the specified model (by the parameter --model) to the output directory "quantized_out". Tht tool also provide the parameter "--algo" for KL divergence algorithm which will improve the accuracy.
  5. Run the INT8 inference with this command python eval_int8.py --iterations=1000 --batch_size=50 --class_dim=1000 --image_shape=3,224,224 --with_mem_opt=True --use_gpu=False --pretrained_model=quantized_out.

Result

  1. Accuracy
Topology FP32 Accuracy(Top-1/Top-5) INT8 Accurary(Top-1/Top-5)
ResNet-50 (FB) 76.63%/93.10% 76.42%/93.07%
MobileNet-V1 70.78%/89.69% 70.10%/89.30%
  1. Performance
Topology FP32 Throughput INT8 Throughput FP32 latency(1x1) INT8 latency(1x1)
ResNet-50 (FB) 260 527 62.4 36.7
MobileNet-V1 1207 1934 9.3 8.4

Note: The above performance measured on SKX8180 1S (HT On, Turbo On) (Throughput imgs/sec; Latency: ms; 1x1: batch size 1 x thread 1)

指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/models!1458
Source branch: github/fork/guomingz/develop
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7