Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
2c07727f
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2c07727f
编写于
11月 08, 2019
作者:
J
juncaipeng
提交者:
GitHub
11月 08, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete test resnet50 in post train quantization to avoid timeout error, test=develop (#21081)
上级
06063b70
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
44 deletion
+0
-44
python/paddle/fluid/contrib/slim/tests/test_post_training_quantization.py
...uid/contrib/slim/tests/test_post_training_quantization.py
+0
-44
未找到文件。
python/paddle/fluid/contrib/slim/tests/test_post_training_quantization.py
浏览文件 @
2c07727f
...
...
@@ -262,50 +262,6 @@ class TestPostTrainingQuantization(unittest.TestCase):
ptq
.
save_quantized_model
(
self
.
int8_model
)
class
TestPostTrainingForResnet50
(
TestPostTrainingQuantization
):
def
download_model
(
self
):
# resnet50 fp32 data
data_urls
=
[
'http://paddle-inference-dist.bj.bcebos.com/int8/resnet50_int8_model.tar.gz'
]
data_md5s
=
[
'4a5194524823d9b76da6e738e1367881'
]
self
.
model_cache_folder
=
self
.
download_data
(
data_urls
,
data_md5s
,
"resnet50_fp32"
)
self
.
model
=
"ResNet-50"
self
.
algo
=
"KL"
def
test_post_training_resnet50
(
self
):
self
.
download_model
()
print
(
"Start FP32 inference for {0} on {1} images ..."
.
format
(
self
.
model
,
self
.
infer_iterations
*
self
.
batch_size
))
(
fp32_throughput
,
fp32_latency
,
fp32_acc1
)
=
self
.
run_program
(
self
.
model_cache_folder
+
"/model"
)
print
(
"Start INT8 post training quantization for {0} on {1} images ..."
.
format
(
self
.
model
,
self
.
sample_iterations
*
self
.
batch_size
))
self
.
generate_quantized_model
(
self
.
model_cache_folder
+
"/model"
,
algo
=
self
.
algo
)
print
(
"Start INT8 inference for {0} on {1} images ..."
.
format
(
self
.
model
,
self
.
infer_iterations
*
self
.
batch_size
))
(
int8_throughput
,
int8_latency
,
int8_acc1
)
=
self
.
run_program
(
self
.
int8_model
)
print
(
"FP32 {0}: batch_size {1}, throughput {2} images/second, latency {3} second, accuracy {4}"
.
format
(
self
.
model
,
self
.
batch_size
,
fp32_throughput
,
fp32_latency
,
fp32_acc1
))
print
(
"INT8 {0}: batch_size {1}, throughput {2} images/second, latency {3} second, accuracy {4}"
.
format
(
self
.
model
,
self
.
batch_size
,
int8_throughput
,
int8_latency
,
int8_acc1
))
sys
.
stdout
.
flush
()
delta_value
=
fp32_acc1
-
int8_acc1
self
.
assertLess
(
delta_value
,
0.025
)
class
TestPostTrainingForMobilenetv1
(
TestPostTrainingQuantization
):
def
download_model
(
self
):
# mobilenetv1 fp32 data
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录