diff --git a/models/resnet50/solver_augment.prototxt b/models/resnet50/solver_augment.prototxt new file mode 100644 index 00000000000..82ecf4dec4b --- /dev/null +++ b/models/resnet50/solver_augment.prototxt @@ -0,0 +1,41 @@ +net: "models/resnet50/train_val_augment.prototxt" + +test_iter: 1562 # 50000/32 +test_interval: 5000 +test_initialization: false + +display: 100 + +# DGX1 ================================= +max_iter: 500000 # 100 epoch B=256 +base_lr: 0.2 # B=256 +# ====================================== + +local_lr_auto: true + +rampup_lr: 0.001 +rampup_interval: 10000 + +lr_policy: "poly" +power: 2.0 +momentum: 0.9 +weight_decay: 1e-4 + +snapshot: 2500000 +snapshot_prefix: "models/resnet50/snapshots/resnet50_augment" +snapshot_after_train: false + +solver_mode: GPU +random_seed: 1 + +# Train dataset size = 1,281,167 +# Test dataset size = 50,000 + +# batch 32 --> epoch = 40,000 +# batch 64 --> epoch = 20,000 +# batch 96 --> epoch = 15,000 +# batch 128 --> epoch = 10,000 +# batch 256 --> epoch = 5,000 +# batch 512 --> epoch = 2,500 + + diff --git a/models/resnet50/train_resnet50_augment.sh b/models/resnet50/train_resnet50_augment.sh new file mode 100755 index 00000000000..2954ced0c66 --- /dev/null +++ b/models/resnet50/train_resnet50_augment.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +./build/tools/caffe train --solver=models/resnet50/solver_augment.prototxt -gpu=all \ + 2>&1 | tee models/resnet50/logs/resnet50_augment.log diff --git a/models/resnet50/train_val_augment.prototxt b/models/resnet50/train_val_augment.prototxt new file mode 100644 index 00000000000..885115f6bf7 --- /dev/null +++ b/models/resnet50/train_val_augment.prototxt @@ -0,0 +1,1925 @@ +name: "Resnet50_augment" + +layer { + name: "data" + type: "Data" + top: "data" + top: "label" + data_param { + source: "examples/imagenet/ilsvrc12_train_lmdb" +# source: "/data/imagenet/train-lmdb-uncompressed-256x256" + backend: LMDB + batch_size: 256 #32 + cache: true + shuffle: true + } + transform_param { + var_sz_img_rand_resize_lower: 256 + var_sz_img_rand_resize_upper: 288 + var_sz_img_rand_crop: 224 +# mean_file: "data/ilsvrc12/imagenet_mean.binaryproto" +# mean_file: "/data/imagenet/imagenet_256x256_mean.binaryproto" + crop_size: 224 + mirror: true + scale: 0.00390625 + } + include: { phase: TRAIN } +} +layer { + name: "data" + type: "Data" + top: "data" + top: "label" + data_param { + source: "examples/imagenet/ilsvrc12_val_lmdb" +# source: "/data/imagenet/val-lmdb-uncompressed-256x256" + backend: LMDB + batch_size: 32 + } + transform_param { +# mean_file: "data/ilsvrc12/imagenet_mean.binaryproto" +# mean_file: "/data/imagenet/imagenet_256x256_mean.binaryproto" + crop_size: 224 + mirror: false + scale: 0.00390625 + } + include: { phase: TEST } +} +layer { + name: "conv1" + type: "Convolution" + bottom: "data" + top: "conv1" + convolution_param { + num_output: 64 + kernel_size: 7 + pad: 3 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "conv1/bn" + type: "BatchNorm" + bottom: "conv1" + top: "conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "conv1/relu" + type: "ReLU" + bottom: "conv1/bn" + top: "conv1/bn" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1/bn" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +# +# res2 +# +layer { + name: "res2.1.conv1" + type: "Convolution" + bottom: "pool1" + top: "res2.1.conv1" + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.1.conv1/bn" + type: "BatchNorm" + bottom: "res2.1.conv1" + top: "res2.1.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.1.conv1/relu" + type: "ReLU" + bottom: "res2.1.conv1/bn" + top: "res2.1.conv1/bn" +} +layer { + name: "res2.1.conv2" + type: "Convolution" + bottom: "res2.1.conv1/bn" + top: "res2.1.conv2" + convolution_param { + num_output: 64 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.1.conv2/bn" + type: "BatchNorm" + bottom: "res2.1.conv2" + top: "res2.1.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.1.conv2/relu" + type: "ReLU" + bottom: "res2.1.conv2/bn" + top: "res2.1.conv2/bn" +} +layer { + name: "res2.1.conv3" + type: "Convolution" + bottom: "res2.1.conv2/bn" + top: "res2.1.conv3" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.1.conv3/bn" + type: "BatchNorm" + bottom: "res2.1.conv3" + top: "res2.1.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.1.skipConv" + type: "Convolution" + bottom: "pool1" + top: "res2.1.skipConv" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.1.skipConv/bn" + type: "BatchNorm" + bottom: "res2.1.skipConv" + top: "res2.1.skipConv/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.1.sum" + type: "Eltwise" + bottom: "res2.1.conv3/bn" + bottom: "res2.1.skipConv/bn" + top: "res2.1.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res2.1.relu" + type: "ReLU" + bottom: "res2.1.sum" + top: "res2.1.sum" +} +layer { + name: "res2.2.conv1" + type: "Convolution" + bottom: "res2.1.sum" + top: "res2.2.conv1" + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.2.conv1/bn" + type: "BatchNorm" + bottom: "res2.2.conv1" + top: "res2.2.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.2.conv1/relu" + type: "ReLU" + bottom: "res2.2.conv1/bn" + top: "res2.2.conv1/bn" +} +layer { + name: "res2.2.conv2" + type: "Convolution" + bottom: "res2.2.conv1/bn" + top: "res2.2.conv2" + convolution_param { + num_output: 64 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.2.conv2/bn" + type: "BatchNorm" + bottom: "res2.2.conv2" + top: "res2.2.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.2.conv2/relu" + type: "ReLU" + bottom: "res2.2.conv2/bn" + top: "res2.2.conv2/bn" +} +layer { + name: "res2.2.conv3" + type: "Convolution" + bottom: "res2.2.conv2/bn" + top: "res2.2.conv3" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.2.conv3/bn" + type: "BatchNorm" + bottom: "res2.2.conv3" + top: "res2.2.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.2.sum" + type: "Eltwise" + bottom: "res2.2.conv3/bn" + bottom: "res2.1.sum" + top: "res2.2.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res2.2.relu" + type: "ReLU" + bottom: "res2.2.sum" + top: "res2.2.sum" +} +layer { + name: "res2.3.conv1" + type: "Convolution" + bottom: "res2.2.sum" + top: "res2.3.conv1" + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.3.conv1/bn" + type: "BatchNorm" + bottom: "res2.3.conv1" + top: "res2.3.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.3.conv1/relu" + type: "ReLU" + bottom: "res2.3.conv1/bn" + top: "res2.3.conv1/bn" +} +layer { + name: "res2.3.conv2" + type: "Convolution" + bottom: "res2.3.conv1/bn" + top: "res2.3.conv2" + convolution_param { + num_output: 64 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.3.conv2/bn" + type: "BatchNorm" + bottom: "res2.3.conv2" + top: "res2.3.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.3.conv2/relu" + type: "ReLU" + bottom: "res2.3.conv2/bn" + top: "res2.3.conv2/bn" +} +layer { + name: "res2.3.conv3" + type: "Convolution" + bottom: "res2.3.conv2/bn" + top: "res2.3.conv3" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res2.3.conv3/bn" + type: "BatchNorm" + bottom: "res2.3.conv3" + top: "res2.3.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res2.3.sum" + type: "Eltwise" + bottom: "res2.3.conv3/bn" + bottom: "res2.2.sum" + top: "res2.3.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res2.3.relu" + type: "ReLU" + bottom: "res2.3.sum" + top: "res2.3.sum" +} +# +# res3 +# +layer { + name: "res3.1.conv1" + type: "Convolution" + bottom: "res2.3.sum" + top: "res3.1.conv1" + convolution_param { + num_output: 128 + kernel_size: 1 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.1.conv1/bn" + type: "BatchNorm" + bottom: "res3.1.conv1" + top: "res3.1.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.1.conv1/relu" + type: "ReLU" + bottom: "res3.1.conv1/bn" + top: "res3.1.conv1/bn" +} +layer { + name: "res3.1.conv2" + type: "Convolution" + bottom: "res3.1.conv1/bn" + top: "res3.1.conv2" + convolution_param { + num_output: 128 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.1.conv2/bn" + type: "BatchNorm" + bottom: "res3.1.conv2" + top: "res3.1.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.1.conv2/relu" + type: "ReLU" + bottom: "res3.1.conv2/bn" + top: "res3.1.conv2/bn" +} +layer { + name: "res3.1.conv3" + type: "Convolution" + bottom: "res3.1.conv2/bn" + top: "res3.1.conv3" + convolution_param { + num_output: 512 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.1.conv3/bn" + type: "BatchNorm" + bottom: "res3.1.conv3" + top: "res3.1.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.1.skipConv" + type: "Convolution" + bottom: "res2.3.sum" + top: "res3.1.skipConv" + convolution_param { + num_output: 512 + kernel_size: 1 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.1.skipConv/bn" + type: "BatchNorm" + bottom: "res3.1.skipConv" + top: "res3.1.skipConv/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.1.sum" + type: "Eltwise" + bottom: "res3.1.conv3/bn" + bottom: "res3.1.skipConv/bn" + top: "res3.1.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res3.1.relu" + type: "ReLU" + bottom: "res3.1.sum" + top: "res3.1.sum" +} +layer { + name: "res3.2.conv1" + type: "Convolution" + bottom: "res3.1.sum" + top: "res3.2.conv1" + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.2.conv1/bn" + type: "BatchNorm" + bottom: "res3.2.conv1" + top: "res3.2.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.2.conv1/relu" + type: "ReLU" + bottom: "res3.2.conv1/bn" + top: "res3.2.conv1/bn" +} +layer { + name: "res3.2.conv2" + type: "Convolution" + bottom: "res3.2.conv1/bn" + top: "res3.2.conv2" + convolution_param { + num_output: 128 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.2.conv2/bn" + type: "BatchNorm" + bottom: "res3.2.conv2" + top: "res3.2.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.2.conv2/relu" + type: "ReLU" + bottom: "res3.2.conv2/bn" + top: "res3.2.conv2/bn" +} +layer { + name: "res3.2.conv3" + type: "Convolution" + bottom: "res3.2.conv2/bn" + top: "res3.2.conv3" + convolution_param { + num_output: 512 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.2.conv3/bn" + type: "BatchNorm" + bottom: "res3.2.conv3" + top: "res3.2.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.2.sum" + type: "Eltwise" + bottom: "res3.2.conv3/bn" + bottom: "res3.1.sum" + top: "res3.2.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res3.2.relu" + type: "ReLU" + bottom: "res3.2.sum" + top: "res3.2.sum" +} +layer { + name: "res3.3.conv1" + type: "Convolution" + bottom: "res3.2.sum" + top: "res3.3.conv1" + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.3.conv1/bn" + type: "BatchNorm" + bottom: "res3.3.conv1" + top: "res3.3.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.3.conv1/relu" + type: "ReLU" + bottom: "res3.3.conv1/bn" + top: "res3.3.conv1/bn" +} +layer { + name: "res3.3.conv2" + type: "Convolution" + bottom: "res3.3.conv1/bn" + top: "res3.3.conv2" + convolution_param { + num_output: 128 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.3.conv2/bn" + type: "BatchNorm" + bottom: "res3.3.conv2" + top: "res3.3.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.3.conv2/relu" + type: "ReLU" + bottom: "res3.3.conv2/bn" + top: "res3.3.conv2/bn" +} +layer { + name: "res3.3.conv3" + type: "Convolution" + bottom: "res3.3.conv2/bn" + top: "res3.3.conv3" + convolution_param { + num_output: 512 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.3.conv3/bn" + type: "BatchNorm" + bottom: "res3.3.conv3" + top: "res3.3.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.3.sum" + type: "Eltwise" + bottom: "res3.3.conv3/bn" + bottom: "res3.2.sum" + top: "res3.3.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res3.3.relu" + type: "ReLU" + bottom: "res3.3.sum" + top: "res3.3.sum" +} +layer { + name: "res3.4.conv1" + type: "Convolution" + bottom: "res3.3.sum" + top: "res3.4.conv1" + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.4.conv1/bn" + type: "BatchNorm" + bottom: "res3.4.conv1" + top: "res3.4.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.4.conv1/relu" + type: "ReLU" + bottom: "res3.4.conv1/bn" + top: "res3.4.conv1/bn" +} +layer { + name: "res3.4.conv2" + type: "Convolution" + bottom: "res3.4.conv1/bn" + top: "res3.4.conv2" + convolution_param { + num_output: 128 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.4.conv2/bn" + type: "BatchNorm" + bottom: "res3.4.conv2" + top: "res3.4.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.4.conv2/relu" + type: "ReLU" + bottom: "res3.4.conv2/bn" + top: "res3.4.conv2/bn" +} +layer { + name: "res3.4.conv3" + type: "Convolution" + bottom: "res3.4.conv2/bn" + top: "res3.4.conv3" + convolution_param { + num_output: 512 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res3.4.conv3/bn" + type: "BatchNorm" + bottom: "res3.4.conv3" + top: "res3.4.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res3.4.sum" + type: "Eltwise" + bottom: "res3.4.conv3/bn" + bottom: "res3.3.sum" + top: "res3.4.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res3.4.relu" + type: "ReLU" + bottom: "res3.4.sum" + top: "res3.4.sum" +} +# +# res4 +# +layer { + name: "res4.1.conv1" + type: "Convolution" + bottom: "res3.4.sum" + top: "res4.1.conv1" + convolution_param { + num_output: 256 + kernel_size: 1 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.1.conv1/bn" + type: "BatchNorm" + bottom: "res4.1.conv1" + top: "res4.1.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.1.conv1/relu" + type: "ReLU" + bottom: "res4.1.conv1/bn" + top: "res4.1.conv1/bn" +} +layer { + name: "res4.1.conv2" + type: "Convolution" + bottom: "res4.1.conv1/bn" + top: "res4.1.conv2" + convolution_param { + num_output: 256 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.1.conv2/bn" + type: "BatchNorm" + bottom: "res4.1.conv2" + top: "res4.1.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.1.conv2/relu" + type: "ReLU" + bottom: "res4.1.conv2/bn" + top: "res4.1.conv2/bn" +} +layer { + name: "res4.1.conv3" + type: "Convolution" + bottom: "res4.1.conv2/bn" + top: "res4.1.conv3" + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.1.conv3/bn" + type: "BatchNorm" + bottom: "res4.1.conv3" + top: "res4.1.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.1.skipConv" + type: "Convolution" + bottom: "res3.4.sum" + top: "res4.1.skipConv" + convolution_param { + num_output: 1024 + kernel_size: 1 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.1.skipConv/bn" + type: "BatchNorm" + bottom: "res4.1.skipConv" + top: "res4.1.skipConv/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.1.sum" + type: "Eltwise" + bottom: "res4.1.conv3/bn" + bottom: "res4.1.skipConv/bn" + top: "res4.1.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res4.1.relu" + type: "ReLU" + bottom: "res4.1.sum" + top: "res4.1.sum" +} +layer { + name: "res4.2.conv1" + type: "Convolution" + bottom: "res4.1.sum" + top: "res4.2.conv1" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.2.conv1/bn" + type: "BatchNorm" + bottom: "res4.2.conv1" + top: "res4.2.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.2.conv1/relu" + type: "ReLU" + bottom: "res4.2.conv1/bn" + top: "res4.2.conv1/bn" +} +layer { + name: "res4.2.conv2" + type: "Convolution" + bottom: "res4.2.conv1/bn" + top: "res4.2.conv2" + convolution_param { + num_output: 256 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.2.conv2/bn" + type: "BatchNorm" + bottom: "res4.2.conv2" + top: "res4.2.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.2.conv2/relu" + type: "ReLU" + bottom: "res4.2.conv2/bn" + top: "res4.2.conv2/bn" +} +layer { + name: "res4.2.conv3" + type: "Convolution" + bottom: "res4.2.conv2/bn" + top: "res4.2.conv3" + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.2.conv3/bn" + type: "BatchNorm" + bottom: "res4.2.conv3" + top: "res4.2.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.2.sum" + type: "Eltwise" + bottom: "res4.2.conv3/bn" + bottom: "res4.1.sum" + top: "res4.2.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res4.2.relu" + type: "ReLU" + bottom: "res4.2.sum" + top: "res4.2.sum" +} +layer { + name: "res4.3.conv1" + type: "Convolution" + bottom: "res4.2.sum" + top: "res4.3.conv1" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.3.conv1/bn" + type: "BatchNorm" + bottom: "res4.3.conv1" + top: "res4.3.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.3.conv1/relu" + type: "ReLU" + bottom: "res4.3.conv1/bn" + top: "res4.3.conv1/bn" +} +layer { + name: "res4.3.conv2" + type: "Convolution" + bottom: "res4.3.conv1/bn" + top: "res4.3.conv2" + convolution_param { + num_output: 256 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.3.conv2/bn" + type: "BatchNorm" + bottom: "res4.3.conv2" + top: "res4.3.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.3.conv2/relu" + type: "ReLU" + bottom: "res4.3.conv2/bn" + top: "res4.3.conv2/bn" +} +layer { + name: "res4.3.conv3" + type: "Convolution" + bottom: "res4.3.conv2/bn" + top: "res4.3.conv3" + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.3.conv3/bn" + type: "BatchNorm" + bottom: "res4.3.conv3" + top: "res4.3.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.3.sum" + type: "Eltwise" + bottom: "res4.3.conv3/bn" + bottom: "res4.2.sum" + top: "res4.3.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res4.3.relu" + type: "ReLU" + bottom: "res4.3.sum" + top: "res4.3.sum" +} +layer { + name: "res4.4.conv1" + type: "Convolution" + bottom: "res4.3.sum" + top: "res4.4.conv1" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.4.conv1/bn" + type: "BatchNorm" + bottom: "res4.4.conv1" + top: "res4.4.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.4.conv1/relu" + type: "ReLU" + bottom: "res4.4.conv1/bn" + top: "res4.4.conv1/bn" +} +layer { + name: "res4.4.conv2" + type: "Convolution" + bottom: "res4.4.conv1/bn" + top: "res4.4.conv2" + convolution_param { + num_output: 256 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.4.conv2/bn" + type: "BatchNorm" + bottom: "res4.4.conv2" + top: "res4.4.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.4.conv2/relu" + type: "ReLU" + bottom: "res4.4.conv2/bn" + top: "res4.4.conv2/bn" +} +layer { + name: "res4.4.conv3" + type: "Convolution" + bottom: "res4.4.conv2/bn" + top: "res4.4.conv3" + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.4.conv3/bn" + type: "BatchNorm" + bottom: "res4.4.conv3" + top: "res4.4.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.4.sum" + type: "Eltwise" + bottom: "res4.4.conv3/bn" + bottom: "res4.3.sum" + top: "res4.4.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res4.4.relu" + type: "ReLU" + bottom: "res4.4.sum" + top: "res4.4.sum" +} +layer { + name: "res4.5.conv1" + type: "Convolution" + bottom: "res4.4.sum" + top: "res4.5.conv1" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.5.conv1/bn" + type: "BatchNorm" + bottom: "res4.5.conv1" + top: "res4.5.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.5.conv1/relu" + type: "ReLU" + bottom: "res4.5.conv1/bn" + top: "res4.5.conv1/bn" +} +layer { + name: "res4.5.conv2" + type: "Convolution" + bottom: "res4.5.conv1/bn" + top: "res4.5.conv2" + convolution_param { + num_output: 256 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.5.conv2/bn" + type: "BatchNorm" + bottom: "res4.5.conv2" + top: "res4.5.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.5.conv2/relu" + type: "ReLU" + bottom: "res4.5.conv2/bn" + top: "res4.5.conv2/bn" +} +layer { + name: "res4.5.conv3" + type: "Convolution" + bottom: "res4.5.conv2/bn" + top: "res4.5.conv3" + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.5.conv3/bn" + type: "BatchNorm" + bottom: "res4.5.conv3" + top: "res4.5.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.5.sum" + type: "Eltwise" + bottom: "res4.5.conv3/bn" + bottom: "res4.4.sum" + top: "res4.5.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res4.5.relu" + type: "ReLU" + bottom: "res4.5.sum" + top: "res4.5.sum" +} +layer { + name: "res4.6.conv1" + type: "Convolution" + bottom: "res4.5.sum" + top: "res4.6.conv1" + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.6.conv1/bn" + type: "BatchNorm" + bottom: "res4.6.conv1" + top: "res4.6.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.6.conv1/relu" + type: "ReLU" + bottom: "res4.6.conv1/bn" + top: "res4.6.conv1/bn" +} +layer { + name: "res4.6.conv2" + type: "Convolution" + bottom: "res4.6.conv1/bn" + top: "res4.6.conv2" + convolution_param { + num_output: 256 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.6.conv2/bn" + type: "BatchNorm" + bottom: "res4.6.conv2" + top: "res4.6.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.6.conv2/relu" + type: "ReLU" + bottom: "res4.6.conv2/bn" + top: "res4.6.conv2/bn" +} +layer { + name: "res4.6.conv3" + type: "Convolution" + bottom: "res4.6.conv2/bn" + top: "res4.6.conv3" + convolution_param { + num_output: 1024 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res4.6.conv3/bn" + type: "BatchNorm" + bottom: "res4.6.conv3" + top: "res4.6.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res4.6.sum" + type: "Eltwise" + bottom: "res4.6.conv3/bn" + bottom: "res4.5.sum" + top: "res4.6.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res4.6.relu" + type: "ReLU" + bottom: "res4.6.sum" + top: "res4.6.sum" +} +# +# res5 +# +layer { + name: "res5.1.conv1" + type: "Convolution" + bottom: "res4.6.sum" + top: "res5.1.conv1" + convolution_param { + num_output: 512 + kernel_size: 1 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.1.conv1/bn" + type: "BatchNorm" + bottom: "res5.1.conv1" + top: "res5.1.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.1.conv1/relu" + type: "ReLU" + bottom: "res5.1.conv1/bn" + top: "res5.1.conv1/bn" +} +layer { + name: "res5.1.conv2" + type: "Convolution" + bottom: "res5.1.conv1/bn" + top: "res5.1.conv2" + convolution_param { + num_output: 512 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.1.conv2/bn" + type: "BatchNorm" + bottom: "res5.1.conv2" + top: "res5.1.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.1.conv2/relu" + type: "ReLU" + bottom: "res5.1.conv2/bn" + top: "res5.1.conv2/bn" +} +layer { + name: "res5.1.conv3" + type: "Convolution" + bottom: "res5.1.conv2/bn" + top: "res5.1.conv3" + convolution_param { + num_output: 2048 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.1.conv3/bn" + type: "BatchNorm" + bottom: "res5.1.conv3" + top: "res5.1.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.1.skipConv" + type: "Convolution" + bottom: "res4.6.sum" + top: "res5.1.skipConv" + convolution_param { + num_output: 2048 + kernel_size: 1 + stride: 2 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.1.skipConv/bn" + type: "BatchNorm" + bottom: "res5.1.skipConv" + top: "res5.1.skipConv/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.1.sum" + type: "Eltwise" + bottom: "res5.1.conv3/bn" + bottom: "res5.1.skipConv/bn" + top: "res5.1.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res5.1.relu" + type: "ReLU" + bottom: "res5.1.sum" + top: "res5.1.sum" +} +layer { + name: "res5.2.conv1" + type: "Convolution" + bottom: "res5.1.sum" + top: "res5.2.conv1" + convolution_param { + num_output: 512 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.2.conv1/bn" + type: "BatchNorm" + bottom: "res5.2.conv1" + top: "res5.2.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.2.conv1/relu" + type: "ReLU" + bottom: "res5.2.conv1/bn" + top: "res5.2.conv1/bn" +} +layer { + name: "res5.2.conv2" + type: "Convolution" + bottom: "res5.2.conv1/bn" + top: "res5.2.conv2" + convolution_param { + num_output: 512 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.2.conv2/bn" + type: "BatchNorm" + bottom: "res5.2.conv2" + top: "res5.2.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.2.conv2/relu" + type: "ReLU" + bottom: "res5.2.conv2/bn" + top: "res5.2.conv2/bn" +} +layer { + name: "res5.2.conv3" + type: "Convolution" + bottom: "res5.2.conv2/bn" + top: "res5.2.conv3" + convolution_param { + num_output: 2048 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.2.conv3/bn" + type: "BatchNorm" + bottom: "res5.2.conv3" + top: "res5.2.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.2.sum" + type: "Eltwise" + bottom: "res5.2.conv3/bn" + bottom: "res5.1.sum" + top: "res5.2.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res5.2.relu" + type: "ReLU" + bottom: "res5.2.sum" + top: "res5.2.sum" +} +layer { + name: "res5.3.conv1" + type: "Convolution" + bottom: "res5.2.sum" + top: "res5.3.conv1" + convolution_param { + num_output: 512 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.3.conv1/bn" + type: "BatchNorm" + bottom: "res5.3.conv1" + top: "res5.3.conv1/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.3.conv1/relu" + type: "ReLU" + bottom: "res5.3.conv1/bn" + top: "res5.3.conv1/bn" +} +layer { + name: "res5.3.conv2" + type: "Convolution" + bottom: "res5.3.conv1/bn" + top: "res5.3.conv2" + convolution_param { + num_output: 512 + kernel_size: 3 + pad: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.3.conv2/bn" + type: "BatchNorm" + bottom: "res5.3.conv2" + top: "res5.3.conv2/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.3.conv2/relu" + type: "ReLU" + bottom: "res5.3.conv2/bn" + top: "res5.3.conv2/bn" +} +layer { + name: "res5.3.conv3" + type: "Convolution" + bottom: "res5.3.conv2/bn" + top: "res5.3.conv3" + convolution_param { + num_output: 2048 + kernel_size: 1 + weight_filler { + type: "msra" + } + bias_term: false + } +} +layer { + name: "res5.3.conv3/bn" + type: "BatchNorm" + bottom: "res5.3.conv3" + top: "res5.3.conv3/bn" + batch_norm_param { + moving_average_fraction: 0.9 + eps: 0.0001 + scale_bias: true + } +} +layer { + name: "res5.3.sum" + type: "Eltwise" + bottom: "res5.3.conv3/bn" + bottom: "res5.2.sum" + top: "res5.3.sum" + eltwise_param { + operation: SUM + } +} +layer { + name: "res5.3.relu" + type: "ReLU" + bottom: "res5.3.sum" + top: "res5.3.sum" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "res5.3.sum" + top: "pool2" + pooling_param { + pool: AVE + kernel_size: 7 + } +} +layer { + name: "fc" + type: "InnerProduct" + bottom: "pool2" + top: "fc" + inner_product_param { + num_output: 1000 + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "fc" + bottom: "label" + top: "loss" + } + +layer { + name: "accuracy/top-1" + type: "Accuracy" + bottom: "fc" + bottom: "label" + top: "accuracy/top-1" + accuracy_param { top_k: 1 } +# include { phase: TEST } +} +layer { + name: "accuracy/top-5" + type: "Accuracy" + bottom: "fc" + bottom: "label" + top: "accuracy/top-5" + accuracy_param { top_k: 5 } +# include { phase: TEST } +}