Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
ee49f54e
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看板
提交
ee49f54e
编写于
12月 19, 2017
作者:
T
tensor-tang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use small samples to infer openblas for saving time.
上级
a87f4963
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
18 addition
and
9 deletion
+18
-9
benchmark/paddle/image/googlenet.py
benchmark/paddle/image/googlenet.py
+3
-1
benchmark/paddle/image/provider.py
benchmark/paddle/image/provider.py
+2
-1
benchmark/paddle/image/resnet.py
benchmark/paddle/image/resnet.py
+3
-1
benchmark/paddle/image/run_openblas_infer.sh
benchmark/paddle/image/run_openblas_infer.sh
+6
-5
benchmark/paddle/image/run_openblas_train.sh
benchmark/paddle/image/run_openblas_train.sh
+1
-0
benchmark/paddle/image/vgg.py
benchmark/paddle/image/vgg.py
+3
-1
未找到文件。
benchmark/paddle/image/googlenet.py
浏览文件 @
ee49f54e
...
@@ -7,13 +7,15 @@ num_class = 1000
...
@@ -7,13 +7,15 @@ num_class = 1000
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
128
)
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
128
)
use_gpu
=
get_config_arg
(
'use_gpu'
,
bool
,
True
)
use_gpu
=
get_config_arg
(
'use_gpu'
,
bool
,
True
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
num_samples
=
get_config_arg
(
'num_samples'
,
int
,
2560
)
args
=
{
args
=
{
'height'
:
height
,
'height'
:
height
,
'width'
:
width
,
'width'
:
width
,
'color'
:
True
,
'color'
:
True
,
'num_class'
:
num_class
,
'num_class'
:
num_class
,
'is_infer'
:
is_infer
'is_infer'
:
is_infer
,
'num_samples'
:
num_samples
}
}
define_py_data_sources2
(
define_py_data_sources2
(
"train.list"
if
not
is_infer
else
None
,
"train.list"
if
not
is_infer
else
None
,
...
...
benchmark/paddle/image/provider.py
浏览文件 @
ee49f54e
...
@@ -14,6 +14,7 @@ def initHook(settings, height, width, color, num_class, **kwargs):
...
@@ -14,6 +14,7 @@ def initHook(settings, height, width, color, num_class, **kwargs):
else
:
else
:
settings
.
data_size
=
settings
.
height
*
settings
.
width
settings
.
data_size
=
settings
.
height
*
settings
.
width
settings
.
is_infer
=
kwargs
.
get
(
'is_infer'
,
False
)
settings
.
is_infer
=
kwargs
.
get
(
'is_infer'
,
False
)
settings
.
num_samples
=
kwargs
.
get
(
'num_samples'
,
2560
)
if
settings
.
is_infer
:
if
settings
.
is_infer
:
settings
.
slots
=
[
dense_vector
(
settings
.
data_size
)]
settings
.
slots
=
[
dense_vector
(
settings
.
data_size
)]
else
:
else
:
...
@@ -23,7 +24,7 @@ def initHook(settings, height, width, color, num_class, **kwargs):
...
@@ -23,7 +24,7 @@ def initHook(settings, height, width, color, num_class, **kwargs):
@
provider
(
@
provider
(
init_hook
=
initHook
,
min_pool_size
=-
1
,
cache
=
CacheType
.
CACHE_PASS_IN_MEM
)
init_hook
=
initHook
,
min_pool_size
=-
1
,
cache
=
CacheType
.
CACHE_PASS_IN_MEM
)
def
process
(
settings
,
file_list
):
def
process
(
settings
,
file_list
):
for
i
in
xrange
(
2560
if
settings
.
is_infer
else
1024
):
for
i
in
xrange
(
settings
.
num_samples
):
img
=
np
.
random
.
rand
(
1
,
settings
.
data_size
).
reshape
(
-
1
,
1
).
flatten
()
img
=
np
.
random
.
rand
(
1
,
settings
.
data_size
).
reshape
(
-
1
,
1
).
flatten
()
if
settings
.
is_infer
:
if
settings
.
is_infer
:
yield
img
.
astype
(
'float32'
)
yield
img
.
astype
(
'float32'
)
...
...
benchmark/paddle/image/resnet.py
浏览文件 @
ee49f54e
...
@@ -7,13 +7,15 @@ num_class = 1000
...
@@ -7,13 +7,15 @@ num_class = 1000
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
64
)
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
64
)
layer_num
=
get_config_arg
(
"layer_num"
,
int
,
50
)
layer_num
=
get_config_arg
(
"layer_num"
,
int
,
50
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
num_samples
=
get_config_arg
(
'num_samples'
,
int
,
2560
)
args
=
{
args
=
{
'height'
:
height
,
'height'
:
height
,
'width'
:
width
,
'width'
:
width
,
'color'
:
True
,
'color'
:
True
,
'num_class'
:
num_class
,
'num_class'
:
num_class
,
'is_infer'
:
is_infer
'is_infer'
:
is_infer
,
'num_samples'
:
num_samples
}
}
define_py_data_sources2
(
define_py_data_sources2
(
"train.list"
if
not
is_infer
else
None
,
"train.list"
if
not
is_infer
else
None
,
...
...
benchmark/paddle/image/run_openblas_infer.sh
浏览文件 @
ee49f54e
...
@@ -23,24 +23,25 @@ function infer() {
...
@@ -23,24 +23,25 @@ function infer() {
echo
"./run_mkl_infer.sh to save the model first"
echo
"./run_mkl_infer.sh to save the model first"
exit
0
exit
0
fi
fi
log_period
=
$((
256
/
bs
))
log_period
=
$((
32
/
bs
))
paddle train
--job
=
test
\
paddle train
--job
=
test
\
--config
=
"
${
topology
}
.py"
\
--config
=
"
${
topology
}
.py"
\
--use_mkldnn
=
False
\
--use_gpu
=
False
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--trainer_count
=
$thread
\
--log_period
=
$log_period
\
--log_period
=
$log_period
\
--config_args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
,is_infer=True"
\
--config_args
=
"batch_size=
${
bs
}
,layer_num=
${
layer_num
}
,is_infer=True
,num_samples=256
"
\
--init_model_path
=
$models_in
\
--init_model_path
=
$models_in
\
2>&1 |
tee
${
log
}
2>&1 |
tee
${
log
}
# calculate the last 5 logs period time of 1
280
samples,
# calculate the last 5 logs period time of 1
60(=32*5)
samples,
# the time before are burning time.
# the time before are burning time.
start
=
`
tail
${
log
}
-n
7 |
head
-n
1 |
awk
-F
' '
'{print $2}'
| xargs
`
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
`
end
=
`
tail
${
log
}
-n
2 |
head
-n
1 |
awk
-F
' '
'{print $2}'
| xargs
`
start_sec
=
`
clock_to_seconds
$start
`
start_sec
=
`
clock_to_seconds
$start
`
end_sec
=
`
clock_to_seconds
$end
`
end_sec
=
`
clock_to_seconds
$end
`
fps
=
`
awk
'BEGIN{printf "%.2f",(1
28
0 / ('
$end_sec
' - '
$start_sec
'))}'
`
fps
=
`
awk
'BEGIN{printf "%.2f",(1
6
0 / ('
$end_sec
' - '
$start_sec
'))}'
`
echo
"Last 1
28
0 samples start:
${
start
}
(
${
start_sec
}
sec), end:
${
end
}
(
${
end_sec
}
sec;"
>>
${
log
}
echo
"Last 1
6
0 samples start:
${
start
}
(
${
start_sec
}
sec), end:
${
end
}
(
${
end_sec
}
sec;"
>>
${
log
}
echo
"FPS:
$fps
images/sec"
2>&1 |
tee
-a
${
log
}
echo
"FPS:
$fps
images/sec"
2>&1 |
tee
-a
${
log
}
}
}
...
...
benchmark/paddle/image/run_openblas_train.sh
浏览文件 @
ee49f54e
...
@@ -12,6 +12,7 @@ function train() {
...
@@ -12,6 +12,7 @@ function train() {
config
=
"
${
topology
}
.py"
config
=
"
${
topology
}
.py"
paddle train
--job
=
time
\
paddle train
--job
=
time
\
--config
=
$config
\
--config
=
$config
\
--use_mkldnn
=
False
\
--use_gpu
=
False
\
--use_gpu
=
False
\
--trainer_count
=
$thread
\
--trainer_count
=
$thread
\
--log_period
=
10
\
--log_period
=
10
\
...
...
benchmark/paddle/image/vgg.py
浏览文件 @
ee49f54e
...
@@ -7,13 +7,15 @@ num_class = 1000
...
@@ -7,13 +7,15 @@ num_class = 1000
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
64
)
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
64
)
layer_num
=
get_config_arg
(
'layer_num'
,
int
,
19
)
layer_num
=
get_config_arg
(
'layer_num'
,
int
,
19
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
num_samples
=
get_config_arg
(
'num_samples'
,
int
,
2560
)
args
=
{
args
=
{
'height'
:
height
,
'height'
:
height
,
'width'
:
width
,
'width'
:
width
,
'color'
:
True
,
'color'
:
True
,
'num_class'
:
num_class
,
'num_class'
:
num_class
,
'is_infer'
:
is_infer
'is_infer'
:
is_infer
,
'num_samples'
:
num_samples
}
}
define_py_data_sources2
(
define_py_data_sources2
(
"train.list"
if
not
is_infer
else
None
,
"train.list"
if
not
is_infer
else
None
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录