Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
1818d1d9
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1818d1d9
编写于
4月 09, 2019
作者:
C
chuanqiw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reduce test_calibration test time by using large batchsize
test=develop
上级
ed971564
变更
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
浏览文件 @
1818d1d9
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录