提交 19939657 编写于 作者: T tensor-tang

enable training alexnet benchmark

上级 3c6399d1
......@@ -6,6 +6,7 @@ height = 227
width = 227
num_class = 1000
batch_size = get_config_arg('batch_size', int, 128)
use_mkldnn = get_config_arg('use_mkldnn', bool, False)
args = {'height': height, 'width': width, 'color': True, 'num_class': num_class}
define_py_data_sources2(
......@@ -31,7 +32,12 @@ 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=2 if use_mkldnn else 1)
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 +46,21 @@ 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=2 if use_mkldnn else 1)
# 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=2 if use_mkldnn else 1)
net = img_pool_layer(input=net, pool_size=3, stride=2)
net = fc_layer(
......
......@@ -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 group2 $batchsize $use_mkldnn
done
done
......@@ -36,4 +36,5 @@ for batchsize in 64 128 256; do
train vgg 19 $batchsize
train resnet 50 $batchsize
train googlenet v1 $batchsize
train alexnet group2 $batchsize $use_mkldnn
done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册