Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
54be8d9b
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
54be8d9b
编写于
4月 15, 2019
作者:
T
Tao Luo
提交者:
GitHub
4月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16747 from chuanqi129/reduce_test_calibration_time
Reduce test_calibration test time by using large batchsize
上级
bcc0d416
1818d1d9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
6 deletion
+7
-6
python/paddle/fluid/contrib/tests/test_calibration.py
python/paddle/fluid/contrib/tests/test_calibration.py
+7
-6
未找到文件。
python/paddle/fluid/contrib/tests/test_calibration.py
浏览文件 @
54be8d9b
...
@@ -147,10 +147,11 @@ class TestCalibrationForResnet50(unittest.TestCase):
...
@@ -147,10 +147,11 @@ class TestCalibrationForResnet50(unittest.TestCase):
self
.
data_cache_folder
)
self
.
data_cache_folder
)
os
.
system
(
cmd
)
os
.
system
(
cmd
)
self
.
batch_size
=
1
self
.
batch_size
=
1
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
50
self
.
sample_iterations
=
50
self
.
sample_iterations
=
50
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
1
self
.
infer_iterations
=
50000
if
os
.
environ
.
get
(
self
.
infer_iterations
=
50000
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
50
'DATASET'
)
==
'full'
else
1
def
cache_unzipping
(
self
,
target_folder
,
zip_path
):
def
cache_unzipping
(
self
,
target_folder
,
zip_path
):
if
not
os
.
path
.
exists
(
target_folder
):
if
not
os
.
path
.
exists
(
target_folder
):
...
@@ -279,15 +280,15 @@ class TestCalibrationForResnet50(unittest.TestCase):
...
@@ -279,15 +280,15 @@ class TestCalibrationForResnet50(unittest.TestCase):
def
test_calibration
(
self
):
def
test_calibration
(
self
):
self
.
download_model
()
self
.
download_model
()
print
(
"Start FP32 inference for {0} on {1} images ..."
).
format
(
print
(
"Start FP32 inference for {0} on {1} images ..."
).
format
(
self
.
model
,
self
.
infer_iterations
)
self
.
model
,
self
.
infer_iterations
*
self
.
batch_size
)
(
fp32_throughput
,
fp32_latency
,
(
fp32_throughput
,
fp32_latency
,
fp32_acc1
)
=
self
.
run_program
(
self
.
model_cache_folder
+
"/model"
)
fp32_acc1
)
=
self
.
run_program
(
self
.
model_cache_folder
+
"/model"
)
print
(
"Start INT8 calibration for {0} on {1} images ..."
).
format
(
print
(
"Start INT8 calibration for {0} on {1} images ..."
).
format
(
self
.
model
,
self
.
sample_iterations
)
self
.
model
,
self
.
sample_iterations
*
self
.
batch_size
)
self
.
run_program
(
self
.
run_program
(
self
.
model_cache_folder
+
"/model"
,
True
,
algo
=
self
.
algo
)
self
.
model_cache_folder
+
"/model"
,
True
,
algo
=
self
.
algo
)
print
(
"Start INT8 inference for {0} on {1} images ..."
).
format
(
print
(
"Start INT8 inference for {0} on {1} images ..."
).
format
(
self
.
model
,
self
.
infer_iterations
)
self
.
model
,
self
.
infer_iterations
*
self
.
batch_size
)
(
int8_throughput
,
int8_latency
,
(
int8_throughput
,
int8_latency
,
int8_acc1
)
=
self
.
run_program
(
"calibration_out"
)
int8_acc1
)
=
self
.
run_program
(
"calibration_out"
)
delta_value
=
fp32_acc1
-
int8_acc1
delta_value
=
fp32_acc1
-
int8_acc1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录