Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
79b17097
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看板
提交
79b17097
编写于
12月 01, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cal FPS of inference result
上级
aef63944
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
3 deletion
+21
-3
benchmark/paddle/image/provider.py
benchmark/paddle/image/provider.py
+1
-1
benchmark/paddle/image/run_mkldnn_infer.sh
benchmark/paddle/image/run_mkldnn_infer.sh
+20
-2
未找到文件。
benchmark/paddle/image/provider.py
浏览文件 @
79b17097
...
...
@@ -23,7 +23,7 @@ def initHook(settings, height, width, color, num_class, **kwargs):
@
provider
(
init_hook
=
initHook
,
min_pool_size
=-
1
,
cache
=
CacheType
.
CACHE_PASS_IN_MEM
)
def
process
(
settings
,
file_list
):
for
i
in
xrange
(
1024
):
for
i
in
xrange
(
2560
if
settings
.
is_infer
else
1024
):
img
=
np
.
random
.
rand
(
1
,
settings
.
data_size
).
reshape
(
-
1
,
1
).
flatten
()
if
settings
.
is_infer
:
yield
img
.
astype
(
'float32'
)
...
...
benchmark/paddle/image/run_mkldnn_infer.sh
浏览文件 @
79b17097
set
-e
function
clock_to_seconds
()
{
hours
=
`
echo
$1
|
awk
-F
':'
'{print $1}'
`
mins
=
`
echo
$1
|
awk
-F
':'
'{print $2}'
`
secs
=
`
echo
$1
|
awk
-F
':'
'{print $3}'
`
echo
`
bc
-l
<<<
"
$secs
+
$mins
* 60 +
$hours
* 3600"
`
}
function
infer
()
{
unset
OMP_NUM_THREADS MKL_NUM_THREADS OMP_DYNAMIC KMP_AFFINITY
topology
=
$1
...
...
@@ -34,15 +41,26 @@ function infer() {
>
/dev/null 2>&1
echo
"Done"
fi
log_period
=
$((
256
/
bs
))
paddle train
--job
=
test
\
--config
=
"
${
topology
}
.py"
\
--use_mkldnn
=
$use_mkldnn
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--log_period
=
32
\
--log_period
=
$log_period
\
--config_args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
,is_infer=True"
\
--init_model_path
=
$models_in
\
2>&1 |
tee
${
log
}
2>&1 |
tee
${
log
}
# calculate the last 5 logs period time of 1280 samples,
# the time before are burning time.
start
=
`
tail
${
log
}
-n
7 |
head
-n
1 |
awk
-F
' '
'{print $2}'
| xargs
`
end
=
`
tail
${
log
}
-n
2 |
head
-n
1 |
awk
-F
' '
'{print $2}'
| xargs
`
start_sec
=
`
clock_to_seconds
$start
`
end_sec
=
`
clock_to_seconds
$end
`
fps
=
`
bc
<<<
"scale = 2; 1280 / (
$end_sec
-
$start_sec
)"
`
echo
"Last 1280 samples start:
${
start
}
(
${
start_sec
}
sec), end:
${
end
}
(
${
end_sec
}
sec;"
>>
${
log
}
echo
"FPS:
$fps
images/sec"
>>
${
log
}
}
if
[
!
-f
"train.list"
]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录