Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
658dbe6c
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看板
未验证
提交
658dbe6c
编写于
12月 22, 2017
作者:
T
Tao Luo
提交者:
GitHub
12月 22, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6852 from tensor-tang/alexnet
enable alexnet benchmark
上级
0c165124
025a6f3c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
11 deletion
+28
-11
benchmark/paddle/image/alexnet.py
benchmark/paddle/image/alexnet.py
+20
-7
benchmark/paddle/image/run_mkl_infer.sh
benchmark/paddle/image/run_mkl_infer.sh
+3
-2
benchmark/paddle/image/run_mkl_train.sh
benchmark/paddle/image/run_mkl_train.sh
+1
-0
benchmark/paddle/image/run_openblas_infer.sh
benchmark/paddle/image/run_openblas_infer.sh
+3
-2
benchmark/paddle/image/run_openblas_train.sh
benchmark/paddle/image/run_openblas_train.sh
+1
-0
未找到文件。
benchmark/paddle/image/alexnet.py
浏览文件 @
658dbe6c
...
...
@@ -6,8 +6,18 @@ height = 227
width
=
227
num_class
=
1000
batch_size
=
get_config_arg
(
'batch_size'
,
int
,
128
)
gp
=
get_config_arg
(
'layer_num'
,
int
,
1
)
is_infer
=
get_config_arg
(
"is_infer"
,
bool
,
False
)
num_samples
=
get_config_arg
(
'num_samples'
,
int
,
2560
)
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
}
args
=
{
'height'
:
height
,
'width'
:
width
,
'color'
:
True
,
'num_class'
:
num_class
,
'is_infer'
:
is_infer
,
'num_samples'
:
num_samples
}
define_py_data_sources2
(
"train.list"
,
None
,
module
=
"provider"
,
obj
=
"process"
,
args
=
args
)
...
...
@@ -31,7 +41,7 @@ net = img_pool_layer(input=net, pool_size=3, stride=2)
# conv2
net
=
img_conv_layer
(
input
=
net
,
filter_size
=
5
,
num_filters
=
256
,
stride
=
1
,
padding
=
2
,
groups
=
1
)
input
=
net
,
filter_size
=
5
,
num_filters
=
256
,
stride
=
1
,
padding
=
2
,
groups
=
gp
)
net
=
img_cmrnorm_layer
(
input
=
net
,
size
=
5
,
scale
=
0.0001
,
power
=
0.75
)
net
=
img_pool_layer
(
input
=
net
,
pool_size
=
3
,
stride
=
2
)
...
...
@@ -40,11 +50,11 @@ net = img_conv_layer(
input
=
net
,
filter_size
=
3
,
num_filters
=
384
,
stride
=
1
,
padding
=
1
)
# conv4
net
=
img_conv_layer
(
input
=
net
,
filter_size
=
3
,
num_filters
=
384
,
stride
=
1
,
padding
=
1
,
groups
=
1
)
input
=
net
,
filter_size
=
3
,
num_filters
=
384
,
stride
=
1
,
padding
=
1
,
groups
=
gp
)
# conv5
net
=
img_conv_layer
(
input
=
net
,
filter_size
=
3
,
num_filters
=
256
,
stride
=
1
,
padding
=
1
,
groups
=
1
)
input
=
net
,
filter_size
=
3
,
num_filters
=
256
,
stride
=
1
,
padding
=
1
,
groups
=
gp
)
net
=
img_pool_layer
(
input
=
net
,
pool_size
=
3
,
stride
=
2
)
net
=
fc_layer
(
...
...
@@ -59,6 +69,9 @@ net = fc_layer(
layer_attr
=
ExtraAttr
(
drop_rate
=
0.5
))
net
=
fc_layer
(
input
=
net
,
size
=
1000
,
act
=
SoftmaxActivation
())
lab
=
data_layer
(
'label'
,
num_class
)
loss
=
cross_entropy
(
input
=
net
,
label
=
lab
)
outputs
(
loss
)
if
is_infer
:
outputs
(
net
)
else
:
lab
=
data_layer
(
'label'
,
num_class
)
loss
=
cross_entropy
(
input
=
net
,
label
=
lab
)
outputs
(
loss
)
benchmark/paddle/image/run_mkl_infer.sh
浏览文件 @
658dbe6c
...
...
@@ -79,8 +79,9 @@ fi
# inference benchmark
for
use_mkldnn
in
True False
;
do
for
batchsize
in
1 2 4 8 16
;
do
infer googlenet v1
$batchsize
$use_mkldnn
infer resnet 50
$batchsize
$use_mkldnn
infer vgg 19
$batchsize
$use_mkldnn
infer resnet 50
$batchsize
$use_mkldnn
infer googlenet v1
$batchsize
$use_mkldnn
infer alexnet 2
$batchsize
$use_mkldnn
done
done
benchmark/paddle/image/run_mkl_train.sh
浏览文件 @
658dbe6c
...
...
@@ -47,5 +47,6 @@ for use_mkldnn in True False; do
train vgg 19
$batchsize
$use_mkldnn
train resnet 50
$batchsize
$use_mkldnn
train googlenet v1
$batchsize
$use_mkldnn
train alexnet 2
$batchsize
$use_mkldnn
done
done
benchmark/paddle/image/run_openblas_infer.sh
浏览文件 @
658dbe6c
...
...
@@ -57,7 +57,8 @@ fi
# inference benchmark
for
batchsize
in
1 2 4 8 16
;
do
infer googlenet v1
$batchsize
infer resnet 50
$batchsize
infer vgg 19
$batchsize
infer resnet 50
$batchsize
infer googlenet v1
$batchsize
infer alexnet 2
$batchsize
done
benchmark/paddle/image/run_openblas_train.sh
浏览文件 @
658dbe6c
...
...
@@ -37,4 +37,5 @@ for batchsize in 64 128 256; do
train vgg 19
$batchsize
train resnet 50
$batchsize
train googlenet v1
$batchsize
train alexnet 2
$batchsize
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录