├── .gitignore ├── LICENSE ├── README.md ├── generate_caffe_prototxt.sh ├── shufflenet_v2.py ├── shufflenet_v2_x0.5.prototxt ├── shufflenet_v2_x1.0.prototxt ├── shufflenet_v2_x1.5.prototxt ├── shufflenet_v2_x2.0.prototxt └── slim.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2018, miaow1988 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ShuffleNet_V2_pytorch_caffe 2 | ======================================= 3 | ShuffleNet-V2 for both PyTorch and Caffe. 4 | 5 | This project supports both Pytorch and Caffe. 6 | Supported model width are 0.25, 0.33, 0.5, 1.0, 1.5 or 2.0, other model width are not supported. 7 | 8 | Usage 9 | ======================================= 10 | 11 | PyTorch 12 | --------------------------------------- 13 | Just use shufflenet_v2.py as following. 14 | ``` 15 | import torch 16 | import shufflenet_v2 17 | num_classes = 1000 18 | model_width = 0.5 19 | net = shufflenet_v2.Network(num_classes, model_width) 20 | params = torch.load('shufflenet_v2_x0.5.pth', map_location=lambda storage, loc: storage) 21 | net.load_state_dict(params) 22 | input = torch.randn(1,3,224,224) 23 | output = net(input) 24 | ``` 25 | 26 | Caffe 27 | --------------------------------------- 28 | Prototxt files can be generated by shufflenet_v2.py 29 | ``` 30 | python shufflenet_v2.py --save_caffe net --num_classes 1000 --model_width 1.0 31 | ``` 32 | 33 | Converting Model from PyTorch to Caffe 34 | --------------------------------------- 35 | ``` 36 | python shufflenet_v2.py --load_pytorch net.pth --save_caffe net --num_classes 1000 --model_width 1.0 37 | ``` 38 | 39 | Pretrained ImageNet Models for PyTorch and Caffe 40 | ======================================= 41 | Pretrained models can be downloaded from: https://github.com/miaow1988/ShuffleNet_V2_pytorch_caffe/releases 42 | 43 | * shufflenet_v2_x0.25, Top-1 Acc = 46.04%. Unofficial. 44 | * shufflenet_v2_x0.33, Top-1 Acc = 51.40%. Unofficial. 45 | * shufflenet_v2_x0.50, Top-1 Acc = 58.93%. This accuracy is 1.37% lower compared with the result in the official paper. 46 | 47 | Training Details 48 | --------------------------------------- 49 | 1. All ImageNet images are resized by a short edge size of 256 (bicubic interpolation by PIL). And then each of them are pickled by Python and stored in a LMDB dataset. 50 | 2. Training is done by PyTorch 0.4.0 51 | 3. data augmentation: 224x224 random crop and random horizontal flip. No image mean extraction is used here, which is done automatically by data/bn layers in the network. 52 | 4. As in my codes, networks are initialized by nn.init.kaiming_normal_(m.weight, mode='fan_out'). 53 | 5. A SGD with nesterov momentum (0.9) is used for optimizing. The batch size is 1024. Models are trained by 300000 iterations, while the learning rate decayed linearly from 0.5 to 0. 54 | 55 | Something you might have noticed 56 | --------------------------------------- 57 | 1. Models are trained by PyTorch and converted to Caffe. Thus, you should use scale parameter in Caffe's data layer to make sure all input images are rescaled from [0, 255] to [0, 1]. 58 | 2. The RGB~BGR problem is not very crucial, you may just ignore the difference if you are use these models as pretrained models for other tasks. 59 | 60 | Others 61 | --------------------------------------- 62 | All these years, I barely achieved same or higher results of different kinds of complex ImageNet models reported in papers. If you got a better accuracy, please tell me. 63 | -------------------------------------------------------------------------------- /generate_caffe_prototxt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | python shufflenet_v2.py --save_caffe shufflenet_v2_x0.5 --model_width 0.5 3 | python shufflenet_v2.py --save_caffe shufflenet_v2_x1.0 --model_width 1.0 4 | python shufflenet_v2.py --save_caffe shufflenet_v2_x1.5 --model_width 1.5 5 | python shufflenet_v2.py --save_caffe shufflenet_v2_x2.0 --model_width 2.0 -------------------------------------------------------------------------------- /shufflenet_v2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | 4 | from __future__ import absolute_import 5 | from __future__ import division 6 | from __future__ import print_function 7 | 8 | import torch 9 | import torch.nn as nn 10 | 11 | try: 12 | import caffe 13 | from caffe import layers as L 14 | from caffe import params as P 15 | except ImportError: 16 | pass 17 | 18 | import slim 19 | from slim import g_name 20 | 21 | 22 | class BasicBlock(nn.Module): 23 | 24 | def __init__(self, name, in_channels, out_channels, stride, dilation): 25 | super(BasicBlock, self).__init__() 26 | self.g_name = name 27 | self.in_channels = in_channels 28 | self.stride = stride 29 | channels = out_channels//2 30 | if stride == 1: 31 | assert in_channels == out_channels 32 | self.conv = nn.Sequential( 33 | slim.conv_bn_relu(name + '/conv1', channels, channels, 1), 34 | slim.conv_bn(name + '/conv2', 35 | channels, channels, 3, stride=stride, 36 | dilation=dilation, padding=dilation, groups=channels), 37 | slim.conv_bn_relu(name + '/conv3', channels, channels, 1), 38 | ) 39 | else: 40 | self.conv = nn.Sequential( 41 | slim.conv_bn_relu(name + '/conv1', in_channels, channels, 1), 42 | slim.conv_bn(name + '/conv2', 43 | channels, channels, 3, stride=stride, 44 | dilation=dilation, padding=dilation, groups=channels), 45 | slim.conv_bn_relu(name + '/conv3', channels, channels, 1), 46 | ) 47 | self.conv0 = nn.Sequential( 48 | slim.conv_bn(name + '/conv4', 49 | in_channels, in_channels, 3, stride=stride, 50 | dilation=dilation, padding=dilation, groups=in_channels), 51 | slim.conv_bn_relu(name + '/conv5', in_channels, channels, 1), 52 | ) 53 | self.shuffle = slim.channel_shuffle(name + '/shuffle', 2) 54 | 55 | def forward(self, x): 56 | if self.stride == 1: 57 | x1 = x[:, :(x.shape[1]//2), :, :] 58 | x2 = x[:, (x.shape[1]//2):, :, :] 59 | x = torch.cat((x1, self.conv(x2)), 1) 60 | else: 61 | x = torch.cat((self.conv0(x), self.conv(x)), 1) 62 | return self.shuffle(x) 63 | 64 | def generate_caffe_prototxt(self, caffe_net, layer): 65 | if self.stride == 1: 66 | layer_x1, layer_x2 = L.Slice(layer, ntop=2, axis=1, slice_point=[self.in_channels//2]) 67 | caffe_net[self.g_name + '/slice1'] = layer_x1 68 | caffe_net[self.g_name + '/slice2'] = layer_x2 69 | layer_x2 = slim.generate_caffe_prototxt(self.conv, caffe_net, layer_x2) 70 | else: 71 | layer_x1 = slim.generate_caffe_prototxt(self.conv0, caffe_net, layer) 72 | layer_x2 = slim.generate_caffe_prototxt(self.conv, caffe_net, layer) 73 | layer = L.Concat(layer_x1, layer_x2, axis=1) 74 | caffe_net[self.g_name + '/concat'] = layer 75 | layer = slim.generate_caffe_prototxt(self.shuffle, caffe_net, layer) 76 | return layer 77 | 78 | 79 | class Network(nn.Module): 80 | 81 | def __init__(self, num_classes, width_multiplier): 82 | super(Network, self).__init__() 83 | width_config = { 84 | 0.25: (24, 48, 96, 512), 85 | 0.33: (32, 64, 128, 512), 86 | 0.5: (48, 96, 192, 1024), 87 | 1.0: (116, 232, 464, 1024), 88 | 1.5: (176, 352, 704, 1024), 89 | 2.0: (244, 488, 976, 2048), 90 | } 91 | width_config = width_config[width_multiplier] 92 | self.num_classes = num_classes 93 | in_channels = 24 94 | 95 | # outputs, stride, dilation, blocks, type 96 | self.network_config = [ 97 | g_name('data/bn', nn.BatchNorm2d(3)), 98 | slim.conv_bn_relu('stage1/conv', 3, in_channels, 3, 2, 1), 99 | # g_name('stage1/pool', nn.MaxPool2d(3, 2, 1)), 100 | g_name('stage1/pool', nn.MaxPool2d(3, 2, 0, ceil_mode=True)), 101 | (width_config[0], 2, 1, 4, 'b'), 102 | (width_config[1], 2, 1, 8, 'b'), # x16 103 | (width_config[2], 2, 1, 4, 'b'), # x32 104 | slim.conv_bn_relu('conv5', width_config[2], width_config[3], 1), 105 | g_name('pool', nn.AvgPool2d(7, 1)), 106 | g_name('fc', nn.Conv2d(width_config[3], self.num_classes, 1)), 107 | ] 108 | self.network = [] 109 | for i, config in enumerate(self.network_config): 110 | if isinstance(config, nn.Module): 111 | self.network.append(config) 112 | continue 113 | out_channels, stride, dilation, num_blocks, stage_type = config 114 | stage_prefix = 'stage_{}'.format(i - 1) 115 | blocks = [BasicBlock(stage_prefix + '_1', in_channels, 116 | out_channels, stride, dilation)] 117 | for i in range(1, num_blocks): 118 | blocks.append(BasicBlock(stage_prefix + '_{}'.format(i + 1), 119 | out_channels, out_channels, 1, dilation)) 120 | self.network += [nn.Sequential(*blocks)] 121 | 122 | in_channels = out_channels 123 | self.network = nn.Sequential(*self.network) 124 | 125 | for name, m in self.named_modules(): 126 | if any(map(lambda x: isinstance(m, x), [nn.Linear, nn.Conv1d, nn.Conv2d])): 127 | nn.init.kaiming_uniform_(m.weight, mode='fan_in') 128 | if m.bias is not None: 129 | nn.init.constant_(m.bias, 0) 130 | 131 | def trainable_parameters(self): 132 | parameters = [ 133 | {'params': self.cls_head_list.parameters(), 'lr_mult': 1.0}, 134 | {'params': self.loc_head_list.parameters(), 'lr_mult': 1.0}, 135 | # {'params': self.network.parameters(), 'lr_mult': 0.1}, 136 | ] 137 | for i in range(len(self.network)): 138 | lr_mult = 0.1 if i in (0, 1, 2, 3, 4, 5) else 1 139 | parameters.append( 140 | {'params': self.network[i].parameters(), 'lr_mult': lr_mult} 141 | ) 142 | return parameters 143 | 144 | def forward(self, x): 145 | x = self.network(x) 146 | return x.reshape(x.shape[0], -1) 147 | 148 | def generate_caffe_prototxt(self, caffe_net, layer): 149 | data_layer = layer 150 | network = slim.generate_caffe_prototxt(self.network, caffe_net, data_layer) 151 | return network 152 | 153 | def convert_to_caffe(self, name): 154 | caffe_net = caffe.NetSpec() 155 | layer = L.Input(shape=dict(dim=[1, 3, args.image_hw, args.image_hw])) 156 | caffe_net.tops['data'] = layer 157 | slim.generate_caffe_prototxt(self, caffe_net, layer) 158 | print(caffe_net.to_proto()) 159 | with open(name + '.prototxt', 'wb') as f: 160 | f.write(str(caffe_net.to_proto()).encode()) 161 | caffe_net = caffe.Net(name + '.prototxt', caffe.TEST) 162 | slim.convert_pytorch_to_caffe(self, caffe_net) 163 | caffe_net.save(name + '.caffemodel') 164 | 165 | 166 | if __name__ == '__main__': 167 | import sys 168 | import argparse 169 | import PIL.Image 170 | import torchvision 171 | import numpy as np 172 | 173 | def assert_diff(a, b): 174 | if isinstance(a, torch.Tensor): 175 | a = a.detach().cpu().numpy() 176 | if isinstance(b, torch.Tensor): 177 | b = b.detach().cpu().numpy() 178 | print(a.shape, b.shape) 179 | a = a.reshape(-1) 180 | b = b.reshape(-1) 181 | assert a.shape == b.shape 182 | diff = np.abs(a - b) 183 | print('mean diff = %f' % diff.mean()) 184 | assert diff.mean() < 0.001 185 | print('max diff = %f' % diff.max()) 186 | assert diff.max() < 0.001 187 | 188 | parser = argparse.ArgumentParser() 189 | parser.add_argument('--image_hw', type=int, default=224) 190 | parser.add_argument('--num_classes', type=int, default=1000) 191 | parser.add_argument('--model_width', type=float, default=0.5) 192 | parser.add_argument('--load_pytorch', type=str) 193 | parser.add_argument('--save_pytorch', type=str) 194 | parser.add_argument('--save_caffe', type=str) 195 | parser.add_argument('--test', type=str) 196 | args = parser.parse_args() 197 | 198 | if args.test is None: 199 | img = np.random.rand(1, 3, args.image_hw, args.image_hw) 200 | # img = np.ones((1, 3, args.image_hw, args.image_hw)) 201 | else: 202 | img = PIL.Image.open(args.test).convert('RGB') 203 | img = torchvision.transforms.functional.resize(img, (args.image_hw, args.image_hw)) 204 | img = torchvision.transforms.functional.to_tensor(img).unsqueeze(0).numpy() 205 | 206 | ############################################## 207 | # Initilize a PyTorch model. 208 | net = Network(args.num_classes, args.model_width).train(False) 209 | print(net) 210 | if args.load_pytorch is not None: 211 | net.load_state_dict(torch.load(args.load_pytorch, map_location=lambda storage, loc: storage)) 212 | x = torch.tensor(img.copy(), dtype=torch.float32) 213 | with torch.no_grad(): 214 | cls_results = net(x) 215 | print(cls_results.shape) 216 | if args.save_pytorch is not None: 217 | torch.save(net.state_dict(), args.save_pytorch + '.pth') 218 | 219 | ############################################## 220 | # Caffe model generation and converting. 221 | if args.save_caffe is not None: 222 | net.convert_to_caffe(args.save_caffe) 223 | caffe_net = caffe.Net(args.save_caffe + '.prototxt', caffe.TEST, 224 | weights=(args.save_caffe + '.caffemodel')) 225 | caffe_net.blobs['data'].data[...] = img.copy() 226 | caffe_results = caffe_net.forward(blobs=['fc']) 227 | cls_results_caffe = caffe_results['fc'] 228 | print(cls_results_caffe.shape) 229 | assert_diff(cls_results, cls_results_caffe) -------------------------------------------------------------------------------- /shufflenet_v2_x0.5.prototxt: -------------------------------------------------------------------------------- 1 | layer { 2 | name: "data" 3 | type: "Input" 4 | top: "data" 5 | input_param { 6 | shape { 7 | dim: 1 8 | dim: 3 9 | dim: 224 10 | dim: 224 11 | } 12 | } 13 | } 14 | layer { 15 | name: "data/bn" 16 | type: "BatchNorm" 17 | bottom: "data" 18 | top: "data" 19 | param { 20 | lr_mult: 0.0 21 | decay_mult: 0.0 22 | } 23 | param { 24 | lr_mult: 0.0 25 | decay_mult: 0.0 26 | } 27 | param { 28 | lr_mult: 0.0 29 | decay_mult: 0.0 30 | } 31 | } 32 | layer { 33 | name: "data/bn/scale" 34 | type: "Scale" 35 | bottom: "data" 36 | top: "data" 37 | param { 38 | lr_mult: 1.0 39 | decay_mult: 0.0 40 | } 41 | param { 42 | lr_mult: 1.0 43 | decay_mult: 0.0 44 | } 45 | scale_param { 46 | filler { 47 | type: "constant" 48 | value: 1.0 49 | } 50 | bias_term: true 51 | bias_filler { 52 | type: "constant" 53 | value: 0.0 54 | } 55 | } 56 | } 57 | layer { 58 | name: "stage1/conv" 59 | type: "Convolution" 60 | bottom: "data" 61 | top: "stage1/conv" 62 | param { 63 | lr_mult: 1.0 64 | decay_mult: 1.0 65 | } 66 | convolution_param { 67 | num_output: 24 68 | bias_term: false 69 | pad: 1 70 | kernel_size: 3 71 | group: 1 72 | stride: 2 73 | weight_filler { 74 | type: "msra" 75 | } 76 | dilation: 1 77 | } 78 | } 79 | layer { 80 | name: "stage1/conv/bn" 81 | type: "BatchNorm" 82 | bottom: "stage1/conv" 83 | top: "stage1/conv" 84 | param { 85 | lr_mult: 0.0 86 | decay_mult: 0.0 87 | } 88 | param { 89 | lr_mult: 0.0 90 | decay_mult: 0.0 91 | } 92 | param { 93 | lr_mult: 0.0 94 | decay_mult: 0.0 95 | } 96 | } 97 | layer { 98 | name: "stage1/conv/bn/scale" 99 | type: "Scale" 100 | bottom: "stage1/conv" 101 | top: "stage1/conv" 102 | param { 103 | lr_mult: 1.0 104 | decay_mult: 0.0 105 | } 106 | param { 107 | lr_mult: 1.0 108 | decay_mult: 0.0 109 | } 110 | scale_param { 111 | filler { 112 | type: "constant" 113 | value: 1.0 114 | } 115 | bias_term: true 116 | bias_filler { 117 | type: "constant" 118 | value: 0.0 119 | } 120 | } 121 | } 122 | layer { 123 | name: "stage1/conv/relu" 124 | type: "ReLU" 125 | bottom: "stage1/conv" 126 | top: "stage1/conv" 127 | } 128 | layer { 129 | name: "stage1/pool" 130 | type: "Pooling" 131 | bottom: "stage1/conv" 132 | top: "stage1/pool" 133 | pooling_param { 134 | pool: MAX 135 | kernel_size: 3 136 | stride: 2 137 | pad: 0 138 | } 139 | } 140 | layer { 141 | name: "stage_2_1/conv4" 142 | type: "Convolution" 143 | bottom: "stage1/pool" 144 | top: "stage_2_1/conv4" 145 | param { 146 | lr_mult: 1.0 147 | decay_mult: 1.0 148 | } 149 | convolution_param { 150 | num_output: 24 151 | bias_term: false 152 | pad: 1 153 | kernel_size: 3 154 | group: 24 155 | stride: 2 156 | weight_filler { 157 | type: "msra" 158 | } 159 | dilation: 1 160 | } 161 | } 162 | layer { 163 | name: "stage_2_1/conv4/bn" 164 | type: "BatchNorm" 165 | bottom: "stage_2_1/conv4" 166 | top: "stage_2_1/conv4" 167 | param { 168 | lr_mult: 0.0 169 | decay_mult: 0.0 170 | } 171 | param { 172 | lr_mult: 0.0 173 | decay_mult: 0.0 174 | } 175 | param { 176 | lr_mult: 0.0 177 | decay_mult: 0.0 178 | } 179 | } 180 | layer { 181 | name: "stage_2_1/conv4/bn/scale" 182 | type: "Scale" 183 | bottom: "stage_2_1/conv4" 184 | top: "stage_2_1/conv4" 185 | param { 186 | lr_mult: 1.0 187 | decay_mult: 0.0 188 | } 189 | param { 190 | lr_mult: 1.0 191 | decay_mult: 0.0 192 | } 193 | scale_param { 194 | filler { 195 | type: "constant" 196 | value: 1.0 197 | } 198 | bias_term: true 199 | bias_filler { 200 | type: "constant" 201 | value: 0.0 202 | } 203 | } 204 | } 205 | layer { 206 | name: "stage_2_1/conv5" 207 | type: "Convolution" 208 | bottom: "stage_2_1/conv4" 209 | top: "stage_2_1/conv5" 210 | param { 211 | lr_mult: 1.0 212 | decay_mult: 1.0 213 | } 214 | convolution_param { 215 | num_output: 24 216 | bias_term: false 217 | pad: 0 218 | kernel_size: 1 219 | group: 1 220 | stride: 1 221 | weight_filler { 222 | type: "msra" 223 | } 224 | dilation: 1 225 | } 226 | } 227 | layer { 228 | name: "stage_2_1/conv5/bn" 229 | type: "BatchNorm" 230 | bottom: "stage_2_1/conv5" 231 | top: "stage_2_1/conv5" 232 | param { 233 | lr_mult: 0.0 234 | decay_mult: 0.0 235 | } 236 | param { 237 | lr_mult: 0.0 238 | decay_mult: 0.0 239 | } 240 | param { 241 | lr_mult: 0.0 242 | decay_mult: 0.0 243 | } 244 | } 245 | layer { 246 | name: "stage_2_1/conv5/bn/scale" 247 | type: "Scale" 248 | bottom: "stage_2_1/conv5" 249 | top: "stage_2_1/conv5" 250 | param { 251 | lr_mult: 1.0 252 | decay_mult: 0.0 253 | } 254 | param { 255 | lr_mult: 1.0 256 | decay_mult: 0.0 257 | } 258 | scale_param { 259 | filler { 260 | type: "constant" 261 | value: 1.0 262 | } 263 | bias_term: true 264 | bias_filler { 265 | type: "constant" 266 | value: 0.0 267 | } 268 | } 269 | } 270 | layer { 271 | name: "stage_2_1/conv5/relu" 272 | type: "ReLU" 273 | bottom: "stage_2_1/conv5" 274 | top: "stage_2_1/conv5" 275 | } 276 | layer { 277 | name: "stage_2_1/conv1" 278 | type: "Convolution" 279 | bottom: "stage1/pool" 280 | top: "stage_2_1/conv1" 281 | param { 282 | lr_mult: 1.0 283 | decay_mult: 1.0 284 | } 285 | convolution_param { 286 | num_output: 24 287 | bias_term: false 288 | pad: 0 289 | kernel_size: 1 290 | group: 1 291 | stride: 1 292 | weight_filler { 293 | type: "msra" 294 | } 295 | dilation: 1 296 | } 297 | } 298 | layer { 299 | name: "stage_2_1/conv1/bn" 300 | type: "BatchNorm" 301 | bottom: "stage_2_1/conv1" 302 | top: "stage_2_1/conv1" 303 | param { 304 | lr_mult: 0.0 305 | decay_mult: 0.0 306 | } 307 | param { 308 | lr_mult: 0.0 309 | decay_mult: 0.0 310 | } 311 | param { 312 | lr_mult: 0.0 313 | decay_mult: 0.0 314 | } 315 | } 316 | layer { 317 | name: "stage_2_1/conv1/bn/scale" 318 | type: "Scale" 319 | bottom: "stage_2_1/conv1" 320 | top: "stage_2_1/conv1" 321 | param { 322 | lr_mult: 1.0 323 | decay_mult: 0.0 324 | } 325 | param { 326 | lr_mult: 1.0 327 | decay_mult: 0.0 328 | } 329 | scale_param { 330 | filler { 331 | type: "constant" 332 | value: 1.0 333 | } 334 | bias_term: true 335 | bias_filler { 336 | type: "constant" 337 | value: 0.0 338 | } 339 | } 340 | } 341 | layer { 342 | name: "stage_2_1/conv1/relu" 343 | type: "ReLU" 344 | bottom: "stage_2_1/conv1" 345 | top: "stage_2_1/conv1" 346 | } 347 | layer { 348 | name: "stage_2_1/conv2" 349 | type: "Convolution" 350 | bottom: "stage_2_1/conv1" 351 | top: "stage_2_1/conv2" 352 | param { 353 | lr_mult: 1.0 354 | decay_mult: 1.0 355 | } 356 | convolution_param { 357 | num_output: 24 358 | bias_term: false 359 | pad: 1 360 | kernel_size: 3 361 | group: 24 362 | stride: 2 363 | weight_filler { 364 | type: "msra" 365 | } 366 | dilation: 1 367 | } 368 | } 369 | layer { 370 | name: "stage_2_1/conv2/bn" 371 | type: "BatchNorm" 372 | bottom: "stage_2_1/conv2" 373 | top: "stage_2_1/conv2" 374 | param { 375 | lr_mult: 0.0 376 | decay_mult: 0.0 377 | } 378 | param { 379 | lr_mult: 0.0 380 | decay_mult: 0.0 381 | } 382 | param { 383 | lr_mult: 0.0 384 | decay_mult: 0.0 385 | } 386 | } 387 | layer { 388 | name: "stage_2_1/conv2/bn/scale" 389 | type: "Scale" 390 | bottom: "stage_2_1/conv2" 391 | top: "stage_2_1/conv2" 392 | param { 393 | lr_mult: 1.0 394 | decay_mult: 0.0 395 | } 396 | param { 397 | lr_mult: 1.0 398 | decay_mult: 0.0 399 | } 400 | scale_param { 401 | filler { 402 | type: "constant" 403 | value: 1.0 404 | } 405 | bias_term: true 406 | bias_filler { 407 | type: "constant" 408 | value: 0.0 409 | } 410 | } 411 | } 412 | layer { 413 | name: "stage_2_1/conv3" 414 | type: "Convolution" 415 | bottom: "stage_2_1/conv2" 416 | top: "stage_2_1/conv3" 417 | param { 418 | lr_mult: 1.0 419 | decay_mult: 1.0 420 | } 421 | convolution_param { 422 | num_output: 24 423 | bias_term: false 424 | pad: 0 425 | kernel_size: 1 426 | group: 1 427 | stride: 1 428 | weight_filler { 429 | type: "msra" 430 | } 431 | dilation: 1 432 | } 433 | } 434 | layer { 435 | name: "stage_2_1/conv3/bn" 436 | type: "BatchNorm" 437 | bottom: "stage_2_1/conv3" 438 | top: "stage_2_1/conv3" 439 | param { 440 | lr_mult: 0.0 441 | decay_mult: 0.0 442 | } 443 | param { 444 | lr_mult: 0.0 445 | decay_mult: 0.0 446 | } 447 | param { 448 | lr_mult: 0.0 449 | decay_mult: 0.0 450 | } 451 | } 452 | layer { 453 | name: "stage_2_1/conv3/bn/scale" 454 | type: "Scale" 455 | bottom: "stage_2_1/conv3" 456 | top: "stage_2_1/conv3" 457 | param { 458 | lr_mult: 1.0 459 | decay_mult: 0.0 460 | } 461 | param { 462 | lr_mult: 1.0 463 | decay_mult: 0.0 464 | } 465 | scale_param { 466 | filler { 467 | type: "constant" 468 | value: 1.0 469 | } 470 | bias_term: true 471 | bias_filler { 472 | type: "constant" 473 | value: 0.0 474 | } 475 | } 476 | } 477 | layer { 478 | name: "stage_2_1/conv3/relu" 479 | type: "ReLU" 480 | bottom: "stage_2_1/conv3" 481 | top: "stage_2_1/conv3" 482 | } 483 | layer { 484 | name: "stage_2_1/concat" 485 | type: "Concat" 486 | bottom: "stage_2_1/conv5" 487 | bottom: "stage_2_1/conv3" 488 | top: "stage_2_1/concat" 489 | concat_param { 490 | axis: 1 491 | } 492 | } 493 | layer { 494 | name: "stage_2_1/shuffle" 495 | type: "ShuffleChannel" 496 | bottom: "stage_2_1/concat" 497 | top: "stage_2_1/shuffle" 498 | shuffle_channel_param { 499 | group: 2 500 | } 501 | } 502 | layer { 503 | name: "stage_2_2/slice1" 504 | type: "Slice" 505 | bottom: "stage_2_1/shuffle" 506 | top: "stage_2_2/slice1" 507 | top: "stage_2_2/slice2" 508 | slice_param { 509 | slice_point: 24 510 | axis: 1 511 | } 512 | } 513 | layer { 514 | name: "stage_2_2/conv1" 515 | type: "Convolution" 516 | bottom: "stage_2_2/slice2" 517 | top: "stage_2_2/conv1" 518 | param { 519 | lr_mult: 1.0 520 | decay_mult: 1.0 521 | } 522 | convolution_param { 523 | num_output: 24 524 | bias_term: false 525 | pad: 0 526 | kernel_size: 1 527 | group: 1 528 | stride: 1 529 | weight_filler { 530 | type: "msra" 531 | } 532 | dilation: 1 533 | } 534 | } 535 | layer { 536 | name: "stage_2_2/conv1/bn" 537 | type: "BatchNorm" 538 | bottom: "stage_2_2/conv1" 539 | top: "stage_2_2/conv1" 540 | param { 541 | lr_mult: 0.0 542 | decay_mult: 0.0 543 | } 544 | param { 545 | lr_mult: 0.0 546 | decay_mult: 0.0 547 | } 548 | param { 549 | lr_mult: 0.0 550 | decay_mult: 0.0 551 | } 552 | } 553 | layer { 554 | name: "stage_2_2/conv1/bn/scale" 555 | type: "Scale" 556 | bottom: "stage_2_2/conv1" 557 | top: "stage_2_2/conv1" 558 | param { 559 | lr_mult: 1.0 560 | decay_mult: 0.0 561 | } 562 | param { 563 | lr_mult: 1.0 564 | decay_mult: 0.0 565 | } 566 | scale_param { 567 | filler { 568 | type: "constant" 569 | value: 1.0 570 | } 571 | bias_term: true 572 | bias_filler { 573 | type: "constant" 574 | value: 0.0 575 | } 576 | } 577 | } 578 | layer { 579 | name: "stage_2_2/conv1/relu" 580 | type: "ReLU" 581 | bottom: "stage_2_2/conv1" 582 | top: "stage_2_2/conv1" 583 | } 584 | layer { 585 | name: "stage_2_2/conv2" 586 | type: "Convolution" 587 | bottom: "stage_2_2/conv1" 588 | top: "stage_2_2/conv2" 589 | param { 590 | lr_mult: 1.0 591 | decay_mult: 1.0 592 | } 593 | convolution_param { 594 | num_output: 24 595 | bias_term: false 596 | pad: 1 597 | kernel_size: 3 598 | group: 24 599 | stride: 1 600 | weight_filler { 601 | type: "msra" 602 | } 603 | dilation: 1 604 | } 605 | } 606 | layer { 607 | name: "stage_2_2/conv2/bn" 608 | type: "BatchNorm" 609 | bottom: "stage_2_2/conv2" 610 | top: "stage_2_2/conv2" 611 | param { 612 | lr_mult: 0.0 613 | decay_mult: 0.0 614 | } 615 | param { 616 | lr_mult: 0.0 617 | decay_mult: 0.0 618 | } 619 | param { 620 | lr_mult: 0.0 621 | decay_mult: 0.0 622 | } 623 | } 624 | layer { 625 | name: "stage_2_2/conv2/bn/scale" 626 | type: "Scale" 627 | bottom: "stage_2_2/conv2" 628 | top: "stage_2_2/conv2" 629 | param { 630 | lr_mult: 1.0 631 | decay_mult: 0.0 632 | } 633 | param { 634 | lr_mult: 1.0 635 | decay_mult: 0.0 636 | } 637 | scale_param { 638 | filler { 639 | type: "constant" 640 | value: 1.0 641 | } 642 | bias_term: true 643 | bias_filler { 644 | type: "constant" 645 | value: 0.0 646 | } 647 | } 648 | } 649 | layer { 650 | name: "stage_2_2/conv3" 651 | type: "Convolution" 652 | bottom: "stage_2_2/conv2" 653 | top: "stage_2_2/conv3" 654 | param { 655 | lr_mult: 1.0 656 | decay_mult: 1.0 657 | } 658 | convolution_param { 659 | num_output: 24 660 | bias_term: false 661 | pad: 0 662 | kernel_size: 1 663 | group: 1 664 | stride: 1 665 | weight_filler { 666 | type: "msra" 667 | } 668 | dilation: 1 669 | } 670 | } 671 | layer { 672 | name: "stage_2_2/conv3/bn" 673 | type: "BatchNorm" 674 | bottom: "stage_2_2/conv3" 675 | top: "stage_2_2/conv3" 676 | param { 677 | lr_mult: 0.0 678 | decay_mult: 0.0 679 | } 680 | param { 681 | lr_mult: 0.0 682 | decay_mult: 0.0 683 | } 684 | param { 685 | lr_mult: 0.0 686 | decay_mult: 0.0 687 | } 688 | } 689 | layer { 690 | name: "stage_2_2/conv3/bn/scale" 691 | type: "Scale" 692 | bottom: "stage_2_2/conv3" 693 | top: "stage_2_2/conv3" 694 | param { 695 | lr_mult: 1.0 696 | decay_mult: 0.0 697 | } 698 | param { 699 | lr_mult: 1.0 700 | decay_mult: 0.0 701 | } 702 | scale_param { 703 | filler { 704 | type: "constant" 705 | value: 1.0 706 | } 707 | bias_term: true 708 | bias_filler { 709 | type: "constant" 710 | value: 0.0 711 | } 712 | } 713 | } 714 | layer { 715 | name: "stage_2_2/conv3/relu" 716 | type: "ReLU" 717 | bottom: "stage_2_2/conv3" 718 | top: "stage_2_2/conv3" 719 | } 720 | layer { 721 | name: "stage_2_2/concat" 722 | type: "Concat" 723 | bottom: "stage_2_2/slice1" 724 | bottom: "stage_2_2/conv3" 725 | top: "stage_2_2/concat" 726 | concat_param { 727 | axis: 1 728 | } 729 | } 730 | layer { 731 | name: "stage_2_2/shuffle" 732 | type: "ShuffleChannel" 733 | bottom: "stage_2_2/concat" 734 | top: "stage_2_2/shuffle" 735 | shuffle_channel_param { 736 | group: 2 737 | } 738 | } 739 | layer { 740 | name: "stage_2_3/slice1" 741 | type: "Slice" 742 | bottom: "stage_2_2/shuffle" 743 | top: "stage_2_3/slice1" 744 | top: "stage_2_3/slice2" 745 | slice_param { 746 | slice_point: 24 747 | axis: 1 748 | } 749 | } 750 | layer { 751 | name: "stage_2_3/conv1" 752 | type: "Convolution" 753 | bottom: "stage_2_3/slice2" 754 | top: "stage_2_3/conv1" 755 | param { 756 | lr_mult: 1.0 757 | decay_mult: 1.0 758 | } 759 | convolution_param { 760 | num_output: 24 761 | bias_term: false 762 | pad: 0 763 | kernel_size: 1 764 | group: 1 765 | stride: 1 766 | weight_filler { 767 | type: "msra" 768 | } 769 | dilation: 1 770 | } 771 | } 772 | layer { 773 | name: "stage_2_3/conv1/bn" 774 | type: "BatchNorm" 775 | bottom: "stage_2_3/conv1" 776 | top: "stage_2_3/conv1" 777 | param { 778 | lr_mult: 0.0 779 | decay_mult: 0.0 780 | } 781 | param { 782 | lr_mult: 0.0 783 | decay_mult: 0.0 784 | } 785 | param { 786 | lr_mult: 0.0 787 | decay_mult: 0.0 788 | } 789 | } 790 | layer { 791 | name: "stage_2_3/conv1/bn/scale" 792 | type: "Scale" 793 | bottom: "stage_2_3/conv1" 794 | top: "stage_2_3/conv1" 795 | param { 796 | lr_mult: 1.0 797 | decay_mult: 0.0 798 | } 799 | param { 800 | lr_mult: 1.0 801 | decay_mult: 0.0 802 | } 803 | scale_param { 804 | filler { 805 | type: "constant" 806 | value: 1.0 807 | } 808 | bias_term: true 809 | bias_filler { 810 | type: "constant" 811 | value: 0.0 812 | } 813 | } 814 | } 815 | layer { 816 | name: "stage_2_3/conv1/relu" 817 | type: "ReLU" 818 | bottom: "stage_2_3/conv1" 819 | top: "stage_2_3/conv1" 820 | } 821 | layer { 822 | name: "stage_2_3/conv2" 823 | type: "Convolution" 824 | bottom: "stage_2_3/conv1" 825 | top: "stage_2_3/conv2" 826 | param { 827 | lr_mult: 1.0 828 | decay_mult: 1.0 829 | } 830 | convolution_param { 831 | num_output: 24 832 | bias_term: false 833 | pad: 1 834 | kernel_size: 3 835 | group: 24 836 | stride: 1 837 | weight_filler { 838 | type: "msra" 839 | } 840 | dilation: 1 841 | } 842 | } 843 | layer { 844 | name: "stage_2_3/conv2/bn" 845 | type: "BatchNorm" 846 | bottom: "stage_2_3/conv2" 847 | top: "stage_2_3/conv2" 848 | param { 849 | lr_mult: 0.0 850 | decay_mult: 0.0 851 | } 852 | param { 853 | lr_mult: 0.0 854 | decay_mult: 0.0 855 | } 856 | param { 857 | lr_mult: 0.0 858 | decay_mult: 0.0 859 | } 860 | } 861 | layer { 862 | name: "stage_2_3/conv2/bn/scale" 863 | type: "Scale" 864 | bottom: "stage_2_3/conv2" 865 | top: "stage_2_3/conv2" 866 | param { 867 | lr_mult: 1.0 868 | decay_mult: 0.0 869 | } 870 | param { 871 | lr_mult: 1.0 872 | decay_mult: 0.0 873 | } 874 | scale_param { 875 | filler { 876 | type: "constant" 877 | value: 1.0 878 | } 879 | bias_term: true 880 | bias_filler { 881 | type: "constant" 882 | value: 0.0 883 | } 884 | } 885 | } 886 | layer { 887 | name: "stage_2_3/conv3" 888 | type: "Convolution" 889 | bottom: "stage_2_3/conv2" 890 | top: "stage_2_3/conv3" 891 | param { 892 | lr_mult: 1.0 893 | decay_mult: 1.0 894 | } 895 | convolution_param { 896 | num_output: 24 897 | bias_term: false 898 | pad: 0 899 | kernel_size: 1 900 | group: 1 901 | stride: 1 902 | weight_filler { 903 | type: "msra" 904 | } 905 | dilation: 1 906 | } 907 | } 908 | layer { 909 | name: "stage_2_3/conv3/bn" 910 | type: "BatchNorm" 911 | bottom: "stage_2_3/conv3" 912 | top: "stage_2_3/conv3" 913 | param { 914 | lr_mult: 0.0 915 | decay_mult: 0.0 916 | } 917 | param { 918 | lr_mult: 0.0 919 | decay_mult: 0.0 920 | } 921 | param { 922 | lr_mult: 0.0 923 | decay_mult: 0.0 924 | } 925 | } 926 | layer { 927 | name: "stage_2_3/conv3/bn/scale" 928 | type: "Scale" 929 | bottom: "stage_2_3/conv3" 930 | top: "stage_2_3/conv3" 931 | param { 932 | lr_mult: 1.0 933 | decay_mult: 0.0 934 | } 935 | param { 936 | lr_mult: 1.0 937 | decay_mult: 0.0 938 | } 939 | scale_param { 940 | filler { 941 | type: "constant" 942 | value: 1.0 943 | } 944 | bias_term: true 945 | bias_filler { 946 | type: "constant" 947 | value: 0.0 948 | } 949 | } 950 | } 951 | layer { 952 | name: "stage_2_3/conv3/relu" 953 | type: "ReLU" 954 | bottom: "stage_2_3/conv3" 955 | top: "stage_2_3/conv3" 956 | } 957 | layer { 958 | name: "stage_2_3/concat" 959 | type: "Concat" 960 | bottom: "stage_2_3/slice1" 961 | bottom: "stage_2_3/conv3" 962 | top: "stage_2_3/concat" 963 | concat_param { 964 | axis: 1 965 | } 966 | } 967 | layer { 968 | name: "stage_2_3/shuffle" 969 | type: "ShuffleChannel" 970 | bottom: "stage_2_3/concat" 971 | top: "stage_2_3/shuffle" 972 | shuffle_channel_param { 973 | group: 2 974 | } 975 | } 976 | layer { 977 | name: "stage_2_4/slice1" 978 | type: "Slice" 979 | bottom: "stage_2_3/shuffle" 980 | top: "stage_2_4/slice1" 981 | top: "stage_2_4/slice2" 982 | slice_param { 983 | slice_point: 24 984 | axis: 1 985 | } 986 | } 987 | layer { 988 | name: "stage_2_4/conv1" 989 | type: "Convolution" 990 | bottom: "stage_2_4/slice2" 991 | top: "stage_2_4/conv1" 992 | param { 993 | lr_mult: 1.0 994 | decay_mult: 1.0 995 | } 996 | convolution_param { 997 | num_output: 24 998 | bias_term: false 999 | pad: 0 1000 | kernel_size: 1 1001 | group: 1 1002 | stride: 1 1003 | weight_filler { 1004 | type: "msra" 1005 | } 1006 | dilation: 1 1007 | } 1008 | } 1009 | layer { 1010 | name: "stage_2_4/conv1/bn" 1011 | type: "BatchNorm" 1012 | bottom: "stage_2_4/conv1" 1013 | top: "stage_2_4/conv1" 1014 | param { 1015 | lr_mult: 0.0 1016 | decay_mult: 0.0 1017 | } 1018 | param { 1019 | lr_mult: 0.0 1020 | decay_mult: 0.0 1021 | } 1022 | param { 1023 | lr_mult: 0.0 1024 | decay_mult: 0.0 1025 | } 1026 | } 1027 | layer { 1028 | name: "stage_2_4/conv1/bn/scale" 1029 | type: "Scale" 1030 | bottom: "stage_2_4/conv1" 1031 | top: "stage_2_4/conv1" 1032 | param { 1033 | lr_mult: 1.0 1034 | decay_mult: 0.0 1035 | } 1036 | param { 1037 | lr_mult: 1.0 1038 | decay_mult: 0.0 1039 | } 1040 | scale_param { 1041 | filler { 1042 | type: "constant" 1043 | value: 1.0 1044 | } 1045 | bias_term: true 1046 | bias_filler { 1047 | type: "constant" 1048 | value: 0.0 1049 | } 1050 | } 1051 | } 1052 | layer { 1053 | name: "stage_2_4/conv1/relu" 1054 | type: "ReLU" 1055 | bottom: "stage_2_4/conv1" 1056 | top: "stage_2_4/conv1" 1057 | } 1058 | layer { 1059 | name: "stage_2_4/conv2" 1060 | type: "Convolution" 1061 | bottom: "stage_2_4/conv1" 1062 | top: "stage_2_4/conv2" 1063 | param { 1064 | lr_mult: 1.0 1065 | decay_mult: 1.0 1066 | } 1067 | convolution_param { 1068 | num_output: 24 1069 | bias_term: false 1070 | pad: 1 1071 | kernel_size: 3 1072 | group: 24 1073 | stride: 1 1074 | weight_filler { 1075 | type: "msra" 1076 | } 1077 | dilation: 1 1078 | } 1079 | } 1080 | layer { 1081 | name: "stage_2_4/conv2/bn" 1082 | type: "BatchNorm" 1083 | bottom: "stage_2_4/conv2" 1084 | top: "stage_2_4/conv2" 1085 | param { 1086 | lr_mult: 0.0 1087 | decay_mult: 0.0 1088 | } 1089 | param { 1090 | lr_mult: 0.0 1091 | decay_mult: 0.0 1092 | } 1093 | param { 1094 | lr_mult: 0.0 1095 | decay_mult: 0.0 1096 | } 1097 | } 1098 | layer { 1099 | name: "stage_2_4/conv2/bn/scale" 1100 | type: "Scale" 1101 | bottom: "stage_2_4/conv2" 1102 | top: "stage_2_4/conv2" 1103 | param { 1104 | lr_mult: 1.0 1105 | decay_mult: 0.0 1106 | } 1107 | param { 1108 | lr_mult: 1.0 1109 | decay_mult: 0.0 1110 | } 1111 | scale_param { 1112 | filler { 1113 | type: "constant" 1114 | value: 1.0 1115 | } 1116 | bias_term: true 1117 | bias_filler { 1118 | type: "constant" 1119 | value: 0.0 1120 | } 1121 | } 1122 | } 1123 | layer { 1124 | name: "stage_2_4/conv3" 1125 | type: "Convolution" 1126 | bottom: "stage_2_4/conv2" 1127 | top: "stage_2_4/conv3" 1128 | param { 1129 | lr_mult: 1.0 1130 | decay_mult: 1.0 1131 | } 1132 | convolution_param { 1133 | num_output: 24 1134 | bias_term: false 1135 | pad: 0 1136 | kernel_size: 1 1137 | group: 1 1138 | stride: 1 1139 | weight_filler { 1140 | type: "msra" 1141 | } 1142 | dilation: 1 1143 | } 1144 | } 1145 | layer { 1146 | name: "stage_2_4/conv3/bn" 1147 | type: "BatchNorm" 1148 | bottom: "stage_2_4/conv3" 1149 | top: "stage_2_4/conv3" 1150 | param { 1151 | lr_mult: 0.0 1152 | decay_mult: 0.0 1153 | } 1154 | param { 1155 | lr_mult: 0.0 1156 | decay_mult: 0.0 1157 | } 1158 | param { 1159 | lr_mult: 0.0 1160 | decay_mult: 0.0 1161 | } 1162 | } 1163 | layer { 1164 | name: "stage_2_4/conv3/bn/scale" 1165 | type: "Scale" 1166 | bottom: "stage_2_4/conv3" 1167 | top: "stage_2_4/conv3" 1168 | param { 1169 | lr_mult: 1.0 1170 | decay_mult: 0.0 1171 | } 1172 | param { 1173 | lr_mult: 1.0 1174 | decay_mult: 0.0 1175 | } 1176 | scale_param { 1177 | filler { 1178 | type: "constant" 1179 | value: 1.0 1180 | } 1181 | bias_term: true 1182 | bias_filler { 1183 | type: "constant" 1184 | value: 0.0 1185 | } 1186 | } 1187 | } 1188 | layer { 1189 | name: "stage_2_4/conv3/relu" 1190 | type: "ReLU" 1191 | bottom: "stage_2_4/conv3" 1192 | top: "stage_2_4/conv3" 1193 | } 1194 | layer { 1195 | name: "stage_2_4/concat" 1196 | type: "Concat" 1197 | bottom: "stage_2_4/slice1" 1198 | bottom: "stage_2_4/conv3" 1199 | top: "stage_2_4/concat" 1200 | concat_param { 1201 | axis: 1 1202 | } 1203 | } 1204 | layer { 1205 | name: "stage_2_4/shuffle" 1206 | type: "ShuffleChannel" 1207 | bottom: "stage_2_4/concat" 1208 | top: "stage_2_4/shuffle" 1209 | shuffle_channel_param { 1210 | group: 2 1211 | } 1212 | } 1213 | layer { 1214 | name: "stage_3_1/conv4" 1215 | type: "Convolution" 1216 | bottom: "stage_2_4/shuffle" 1217 | top: "stage_3_1/conv4" 1218 | param { 1219 | lr_mult: 1.0 1220 | decay_mult: 1.0 1221 | } 1222 | convolution_param { 1223 | num_output: 48 1224 | bias_term: false 1225 | pad: 1 1226 | kernel_size: 3 1227 | group: 48 1228 | stride: 2 1229 | weight_filler { 1230 | type: "msra" 1231 | } 1232 | dilation: 1 1233 | } 1234 | } 1235 | layer { 1236 | name: "stage_3_1/conv4/bn" 1237 | type: "BatchNorm" 1238 | bottom: "stage_3_1/conv4" 1239 | top: "stage_3_1/conv4" 1240 | param { 1241 | lr_mult: 0.0 1242 | decay_mult: 0.0 1243 | } 1244 | param { 1245 | lr_mult: 0.0 1246 | decay_mult: 0.0 1247 | } 1248 | param { 1249 | lr_mult: 0.0 1250 | decay_mult: 0.0 1251 | } 1252 | } 1253 | layer { 1254 | name: "stage_3_1/conv4/bn/scale" 1255 | type: "Scale" 1256 | bottom: "stage_3_1/conv4" 1257 | top: "stage_3_1/conv4" 1258 | param { 1259 | lr_mult: 1.0 1260 | decay_mult: 0.0 1261 | } 1262 | param { 1263 | lr_mult: 1.0 1264 | decay_mult: 0.0 1265 | } 1266 | scale_param { 1267 | filler { 1268 | type: "constant" 1269 | value: 1.0 1270 | } 1271 | bias_term: true 1272 | bias_filler { 1273 | type: "constant" 1274 | value: 0.0 1275 | } 1276 | } 1277 | } 1278 | layer { 1279 | name: "stage_3_1/conv5" 1280 | type: "Convolution" 1281 | bottom: "stage_3_1/conv4" 1282 | top: "stage_3_1/conv5" 1283 | param { 1284 | lr_mult: 1.0 1285 | decay_mult: 1.0 1286 | } 1287 | convolution_param { 1288 | num_output: 48 1289 | bias_term: false 1290 | pad: 0 1291 | kernel_size: 1 1292 | group: 1 1293 | stride: 1 1294 | weight_filler { 1295 | type: "msra" 1296 | } 1297 | dilation: 1 1298 | } 1299 | } 1300 | layer { 1301 | name: "stage_3_1/conv5/bn" 1302 | type: "BatchNorm" 1303 | bottom: "stage_3_1/conv5" 1304 | top: "stage_3_1/conv5" 1305 | param { 1306 | lr_mult: 0.0 1307 | decay_mult: 0.0 1308 | } 1309 | param { 1310 | lr_mult: 0.0 1311 | decay_mult: 0.0 1312 | } 1313 | param { 1314 | lr_mult: 0.0 1315 | decay_mult: 0.0 1316 | } 1317 | } 1318 | layer { 1319 | name: "stage_3_1/conv5/bn/scale" 1320 | type: "Scale" 1321 | bottom: "stage_3_1/conv5" 1322 | top: "stage_3_1/conv5" 1323 | param { 1324 | lr_mult: 1.0 1325 | decay_mult: 0.0 1326 | } 1327 | param { 1328 | lr_mult: 1.0 1329 | decay_mult: 0.0 1330 | } 1331 | scale_param { 1332 | filler { 1333 | type: "constant" 1334 | value: 1.0 1335 | } 1336 | bias_term: true 1337 | bias_filler { 1338 | type: "constant" 1339 | value: 0.0 1340 | } 1341 | } 1342 | } 1343 | layer { 1344 | name: "stage_3_1/conv5/relu" 1345 | type: "ReLU" 1346 | bottom: "stage_3_1/conv5" 1347 | top: "stage_3_1/conv5" 1348 | } 1349 | layer { 1350 | name: "stage_3_1/conv1" 1351 | type: "Convolution" 1352 | bottom: "stage_2_4/shuffle" 1353 | top: "stage_3_1/conv1" 1354 | param { 1355 | lr_mult: 1.0 1356 | decay_mult: 1.0 1357 | } 1358 | convolution_param { 1359 | num_output: 48 1360 | bias_term: false 1361 | pad: 0 1362 | kernel_size: 1 1363 | group: 1 1364 | stride: 1 1365 | weight_filler { 1366 | type: "msra" 1367 | } 1368 | dilation: 1 1369 | } 1370 | } 1371 | layer { 1372 | name: "stage_3_1/conv1/bn" 1373 | type: "BatchNorm" 1374 | bottom: "stage_3_1/conv1" 1375 | top: "stage_3_1/conv1" 1376 | param { 1377 | lr_mult: 0.0 1378 | decay_mult: 0.0 1379 | } 1380 | param { 1381 | lr_mult: 0.0 1382 | decay_mult: 0.0 1383 | } 1384 | param { 1385 | lr_mult: 0.0 1386 | decay_mult: 0.0 1387 | } 1388 | } 1389 | layer { 1390 | name: "stage_3_1/conv1/bn/scale" 1391 | type: "Scale" 1392 | bottom: "stage_3_1/conv1" 1393 | top: "stage_3_1/conv1" 1394 | param { 1395 | lr_mult: 1.0 1396 | decay_mult: 0.0 1397 | } 1398 | param { 1399 | lr_mult: 1.0 1400 | decay_mult: 0.0 1401 | } 1402 | scale_param { 1403 | filler { 1404 | type: "constant" 1405 | value: 1.0 1406 | } 1407 | bias_term: true 1408 | bias_filler { 1409 | type: "constant" 1410 | value: 0.0 1411 | } 1412 | } 1413 | } 1414 | layer { 1415 | name: "stage_3_1/conv1/relu" 1416 | type: "ReLU" 1417 | bottom: "stage_3_1/conv1" 1418 | top: "stage_3_1/conv1" 1419 | } 1420 | layer { 1421 | name: "stage_3_1/conv2" 1422 | type: "Convolution" 1423 | bottom: "stage_3_1/conv1" 1424 | top: "stage_3_1/conv2" 1425 | param { 1426 | lr_mult: 1.0 1427 | decay_mult: 1.0 1428 | } 1429 | convolution_param { 1430 | num_output: 48 1431 | bias_term: false 1432 | pad: 1 1433 | kernel_size: 3 1434 | group: 48 1435 | stride: 2 1436 | weight_filler { 1437 | type: "msra" 1438 | } 1439 | dilation: 1 1440 | } 1441 | } 1442 | layer { 1443 | name: "stage_3_1/conv2/bn" 1444 | type: "BatchNorm" 1445 | bottom: "stage_3_1/conv2" 1446 | top: "stage_3_1/conv2" 1447 | param { 1448 | lr_mult: 0.0 1449 | decay_mult: 0.0 1450 | } 1451 | param { 1452 | lr_mult: 0.0 1453 | decay_mult: 0.0 1454 | } 1455 | param { 1456 | lr_mult: 0.0 1457 | decay_mult: 0.0 1458 | } 1459 | } 1460 | layer { 1461 | name: "stage_3_1/conv2/bn/scale" 1462 | type: "Scale" 1463 | bottom: "stage_3_1/conv2" 1464 | top: "stage_3_1/conv2" 1465 | param { 1466 | lr_mult: 1.0 1467 | decay_mult: 0.0 1468 | } 1469 | param { 1470 | lr_mult: 1.0 1471 | decay_mult: 0.0 1472 | } 1473 | scale_param { 1474 | filler { 1475 | type: "constant" 1476 | value: 1.0 1477 | } 1478 | bias_term: true 1479 | bias_filler { 1480 | type: "constant" 1481 | value: 0.0 1482 | } 1483 | } 1484 | } 1485 | layer { 1486 | name: "stage_3_1/conv3" 1487 | type: "Convolution" 1488 | bottom: "stage_3_1/conv2" 1489 | top: "stage_3_1/conv3" 1490 | param { 1491 | lr_mult: 1.0 1492 | decay_mult: 1.0 1493 | } 1494 | convolution_param { 1495 | num_output: 48 1496 | bias_term: false 1497 | pad: 0 1498 | kernel_size: 1 1499 | group: 1 1500 | stride: 1 1501 | weight_filler { 1502 | type: "msra" 1503 | } 1504 | dilation: 1 1505 | } 1506 | } 1507 | layer { 1508 | name: "stage_3_1/conv3/bn" 1509 | type: "BatchNorm" 1510 | bottom: "stage_3_1/conv3" 1511 | top: "stage_3_1/conv3" 1512 | param { 1513 | lr_mult: 0.0 1514 | decay_mult: 0.0 1515 | } 1516 | param { 1517 | lr_mult: 0.0 1518 | decay_mult: 0.0 1519 | } 1520 | param { 1521 | lr_mult: 0.0 1522 | decay_mult: 0.0 1523 | } 1524 | } 1525 | layer { 1526 | name: "stage_3_1/conv3/bn/scale" 1527 | type: "Scale" 1528 | bottom: "stage_3_1/conv3" 1529 | top: "stage_3_1/conv3" 1530 | param { 1531 | lr_mult: 1.0 1532 | decay_mult: 0.0 1533 | } 1534 | param { 1535 | lr_mult: 1.0 1536 | decay_mult: 0.0 1537 | } 1538 | scale_param { 1539 | filler { 1540 | type: "constant" 1541 | value: 1.0 1542 | } 1543 | bias_term: true 1544 | bias_filler { 1545 | type: "constant" 1546 | value: 0.0 1547 | } 1548 | } 1549 | } 1550 | layer { 1551 | name: "stage_3_1/conv3/relu" 1552 | type: "ReLU" 1553 | bottom: "stage_3_1/conv3" 1554 | top: "stage_3_1/conv3" 1555 | } 1556 | layer { 1557 | name: "stage_3_1/concat" 1558 | type: "Concat" 1559 | bottom: "stage_3_1/conv5" 1560 | bottom: "stage_3_1/conv3" 1561 | top: "stage_3_1/concat" 1562 | concat_param { 1563 | axis: 1 1564 | } 1565 | } 1566 | layer { 1567 | name: "stage_3_1/shuffle" 1568 | type: "ShuffleChannel" 1569 | bottom: "stage_3_1/concat" 1570 | top: "stage_3_1/shuffle" 1571 | shuffle_channel_param { 1572 | group: 2 1573 | } 1574 | } 1575 | layer { 1576 | name: "stage_3_2/slice1" 1577 | type: "Slice" 1578 | bottom: "stage_3_1/shuffle" 1579 | top: "stage_3_2/slice1" 1580 | top: "stage_3_2/slice2" 1581 | slice_param { 1582 | slice_point: 48 1583 | axis: 1 1584 | } 1585 | } 1586 | layer { 1587 | name: "stage_3_2/conv1" 1588 | type: "Convolution" 1589 | bottom: "stage_3_2/slice2" 1590 | top: "stage_3_2/conv1" 1591 | param { 1592 | lr_mult: 1.0 1593 | decay_mult: 1.0 1594 | } 1595 | convolution_param { 1596 | num_output: 48 1597 | bias_term: false 1598 | pad: 0 1599 | kernel_size: 1 1600 | group: 1 1601 | stride: 1 1602 | weight_filler { 1603 | type: "msra" 1604 | } 1605 | dilation: 1 1606 | } 1607 | } 1608 | layer { 1609 | name: "stage_3_2/conv1/bn" 1610 | type: "BatchNorm" 1611 | bottom: "stage_3_2/conv1" 1612 | top: "stage_3_2/conv1" 1613 | param { 1614 | lr_mult: 0.0 1615 | decay_mult: 0.0 1616 | } 1617 | param { 1618 | lr_mult: 0.0 1619 | decay_mult: 0.0 1620 | } 1621 | param { 1622 | lr_mult: 0.0 1623 | decay_mult: 0.0 1624 | } 1625 | } 1626 | layer { 1627 | name: "stage_3_2/conv1/bn/scale" 1628 | type: "Scale" 1629 | bottom: "stage_3_2/conv1" 1630 | top: "stage_3_2/conv1" 1631 | param { 1632 | lr_mult: 1.0 1633 | decay_mult: 0.0 1634 | } 1635 | param { 1636 | lr_mult: 1.0 1637 | decay_mult: 0.0 1638 | } 1639 | scale_param { 1640 | filler { 1641 | type: "constant" 1642 | value: 1.0 1643 | } 1644 | bias_term: true 1645 | bias_filler { 1646 | type: "constant" 1647 | value: 0.0 1648 | } 1649 | } 1650 | } 1651 | layer { 1652 | name: "stage_3_2/conv1/relu" 1653 | type: "ReLU" 1654 | bottom: "stage_3_2/conv1" 1655 | top: "stage_3_2/conv1" 1656 | } 1657 | layer { 1658 | name: "stage_3_2/conv2" 1659 | type: "Convolution" 1660 | bottom: "stage_3_2/conv1" 1661 | top: "stage_3_2/conv2" 1662 | param { 1663 | lr_mult: 1.0 1664 | decay_mult: 1.0 1665 | } 1666 | convolution_param { 1667 | num_output: 48 1668 | bias_term: false 1669 | pad: 1 1670 | kernel_size: 3 1671 | group: 48 1672 | stride: 1 1673 | weight_filler { 1674 | type: "msra" 1675 | } 1676 | dilation: 1 1677 | } 1678 | } 1679 | layer { 1680 | name: "stage_3_2/conv2/bn" 1681 | type: "BatchNorm" 1682 | bottom: "stage_3_2/conv2" 1683 | top: "stage_3_2/conv2" 1684 | param { 1685 | lr_mult: 0.0 1686 | decay_mult: 0.0 1687 | } 1688 | param { 1689 | lr_mult: 0.0 1690 | decay_mult: 0.0 1691 | } 1692 | param { 1693 | lr_mult: 0.0 1694 | decay_mult: 0.0 1695 | } 1696 | } 1697 | layer { 1698 | name: "stage_3_2/conv2/bn/scale" 1699 | type: "Scale" 1700 | bottom: "stage_3_2/conv2" 1701 | top: "stage_3_2/conv2" 1702 | param { 1703 | lr_mult: 1.0 1704 | decay_mult: 0.0 1705 | } 1706 | param { 1707 | lr_mult: 1.0 1708 | decay_mult: 0.0 1709 | } 1710 | scale_param { 1711 | filler { 1712 | type: "constant" 1713 | value: 1.0 1714 | } 1715 | bias_term: true 1716 | bias_filler { 1717 | type: "constant" 1718 | value: 0.0 1719 | } 1720 | } 1721 | } 1722 | layer { 1723 | name: "stage_3_2/conv3" 1724 | type: "Convolution" 1725 | bottom: "stage_3_2/conv2" 1726 | top: "stage_3_2/conv3" 1727 | param { 1728 | lr_mult: 1.0 1729 | decay_mult: 1.0 1730 | } 1731 | convolution_param { 1732 | num_output: 48 1733 | bias_term: false 1734 | pad: 0 1735 | kernel_size: 1 1736 | group: 1 1737 | stride: 1 1738 | weight_filler { 1739 | type: "msra" 1740 | } 1741 | dilation: 1 1742 | } 1743 | } 1744 | layer { 1745 | name: "stage_3_2/conv3/bn" 1746 | type: "BatchNorm" 1747 | bottom: "stage_3_2/conv3" 1748 | top: "stage_3_2/conv3" 1749 | param { 1750 | lr_mult: 0.0 1751 | decay_mult: 0.0 1752 | } 1753 | param { 1754 | lr_mult: 0.0 1755 | decay_mult: 0.0 1756 | } 1757 | param { 1758 | lr_mult: 0.0 1759 | decay_mult: 0.0 1760 | } 1761 | } 1762 | layer { 1763 | name: "stage_3_2/conv3/bn/scale" 1764 | type: "Scale" 1765 | bottom: "stage_3_2/conv3" 1766 | top: "stage_3_2/conv3" 1767 | param { 1768 | lr_mult: 1.0 1769 | decay_mult: 0.0 1770 | } 1771 | param { 1772 | lr_mult: 1.0 1773 | decay_mult: 0.0 1774 | } 1775 | scale_param { 1776 | filler { 1777 | type: "constant" 1778 | value: 1.0 1779 | } 1780 | bias_term: true 1781 | bias_filler { 1782 | type: "constant" 1783 | value: 0.0 1784 | } 1785 | } 1786 | } 1787 | layer { 1788 | name: "stage_3_2/conv3/relu" 1789 | type: "ReLU" 1790 | bottom: "stage_3_2/conv3" 1791 | top: "stage_3_2/conv3" 1792 | } 1793 | layer { 1794 | name: "stage_3_2/concat" 1795 | type: "Concat" 1796 | bottom: "stage_3_2/slice1" 1797 | bottom: "stage_3_2/conv3" 1798 | top: "stage_3_2/concat" 1799 | concat_param { 1800 | axis: 1 1801 | } 1802 | } 1803 | layer { 1804 | name: "stage_3_2/shuffle" 1805 | type: "ShuffleChannel" 1806 | bottom: "stage_3_2/concat" 1807 | top: "stage_3_2/shuffle" 1808 | shuffle_channel_param { 1809 | group: 2 1810 | } 1811 | } 1812 | layer { 1813 | name: "stage_3_3/slice1" 1814 | type: "Slice" 1815 | bottom: "stage_3_2/shuffle" 1816 | top: "stage_3_3/slice1" 1817 | top: "stage_3_3/slice2" 1818 | slice_param { 1819 | slice_point: 48 1820 | axis: 1 1821 | } 1822 | } 1823 | layer { 1824 | name: "stage_3_3/conv1" 1825 | type: "Convolution" 1826 | bottom: "stage_3_3/slice2" 1827 | top: "stage_3_3/conv1" 1828 | param { 1829 | lr_mult: 1.0 1830 | decay_mult: 1.0 1831 | } 1832 | convolution_param { 1833 | num_output: 48 1834 | bias_term: false 1835 | pad: 0 1836 | kernel_size: 1 1837 | group: 1 1838 | stride: 1 1839 | weight_filler { 1840 | type: "msra" 1841 | } 1842 | dilation: 1 1843 | } 1844 | } 1845 | layer { 1846 | name: "stage_3_3/conv1/bn" 1847 | type: "BatchNorm" 1848 | bottom: "stage_3_3/conv1" 1849 | top: "stage_3_3/conv1" 1850 | param { 1851 | lr_mult: 0.0 1852 | decay_mult: 0.0 1853 | } 1854 | param { 1855 | lr_mult: 0.0 1856 | decay_mult: 0.0 1857 | } 1858 | param { 1859 | lr_mult: 0.0 1860 | decay_mult: 0.0 1861 | } 1862 | } 1863 | layer { 1864 | name: "stage_3_3/conv1/bn/scale" 1865 | type: "Scale" 1866 | bottom: "stage_3_3/conv1" 1867 | top: "stage_3_3/conv1" 1868 | param { 1869 | lr_mult: 1.0 1870 | decay_mult: 0.0 1871 | } 1872 | param { 1873 | lr_mult: 1.0 1874 | decay_mult: 0.0 1875 | } 1876 | scale_param { 1877 | filler { 1878 | type: "constant" 1879 | value: 1.0 1880 | } 1881 | bias_term: true 1882 | bias_filler { 1883 | type: "constant" 1884 | value: 0.0 1885 | } 1886 | } 1887 | } 1888 | layer { 1889 | name: "stage_3_3/conv1/relu" 1890 | type: "ReLU" 1891 | bottom: "stage_3_3/conv1" 1892 | top: "stage_3_3/conv1" 1893 | } 1894 | layer { 1895 | name: "stage_3_3/conv2" 1896 | type: "Convolution" 1897 | bottom: "stage_3_3/conv1" 1898 | top: "stage_3_3/conv2" 1899 | param { 1900 | lr_mult: 1.0 1901 | decay_mult: 1.0 1902 | } 1903 | convolution_param { 1904 | num_output: 48 1905 | bias_term: false 1906 | pad: 1 1907 | kernel_size: 3 1908 | group: 48 1909 | stride: 1 1910 | weight_filler { 1911 | type: "msra" 1912 | } 1913 | dilation: 1 1914 | } 1915 | } 1916 | layer { 1917 | name: "stage_3_3/conv2/bn" 1918 | type: "BatchNorm" 1919 | bottom: "stage_3_3/conv2" 1920 | top: "stage_3_3/conv2" 1921 | param { 1922 | lr_mult: 0.0 1923 | decay_mult: 0.0 1924 | } 1925 | param { 1926 | lr_mult: 0.0 1927 | decay_mult: 0.0 1928 | } 1929 | param { 1930 | lr_mult: 0.0 1931 | decay_mult: 0.0 1932 | } 1933 | } 1934 | layer { 1935 | name: "stage_3_3/conv2/bn/scale" 1936 | type: "Scale" 1937 | bottom: "stage_3_3/conv2" 1938 | top: "stage_3_3/conv2" 1939 | param { 1940 | lr_mult: 1.0 1941 | decay_mult: 0.0 1942 | } 1943 | param { 1944 | lr_mult: 1.0 1945 | decay_mult: 0.0 1946 | } 1947 | scale_param { 1948 | filler { 1949 | type: "constant" 1950 | value: 1.0 1951 | } 1952 | bias_term: true 1953 | bias_filler { 1954 | type: "constant" 1955 | value: 0.0 1956 | } 1957 | } 1958 | } 1959 | layer { 1960 | name: "stage_3_3/conv3" 1961 | type: "Convolution" 1962 | bottom: "stage_3_3/conv2" 1963 | top: "stage_3_3/conv3" 1964 | param { 1965 | lr_mult: 1.0 1966 | decay_mult: 1.0 1967 | } 1968 | convolution_param { 1969 | num_output: 48 1970 | bias_term: false 1971 | pad: 0 1972 | kernel_size: 1 1973 | group: 1 1974 | stride: 1 1975 | weight_filler { 1976 | type: "msra" 1977 | } 1978 | dilation: 1 1979 | } 1980 | } 1981 | layer { 1982 | name: "stage_3_3/conv3/bn" 1983 | type: "BatchNorm" 1984 | bottom: "stage_3_3/conv3" 1985 | top: "stage_3_3/conv3" 1986 | param { 1987 | lr_mult: 0.0 1988 | decay_mult: 0.0 1989 | } 1990 | param { 1991 | lr_mult: 0.0 1992 | decay_mult: 0.0 1993 | } 1994 | param { 1995 | lr_mult: 0.0 1996 | decay_mult: 0.0 1997 | } 1998 | } 1999 | layer { 2000 | name: "stage_3_3/conv3/bn/scale" 2001 | type: "Scale" 2002 | bottom: "stage_3_3/conv3" 2003 | top: "stage_3_3/conv3" 2004 | param { 2005 | lr_mult: 1.0 2006 | decay_mult: 0.0 2007 | } 2008 | param { 2009 | lr_mult: 1.0 2010 | decay_mult: 0.0 2011 | } 2012 | scale_param { 2013 | filler { 2014 | type: "constant" 2015 | value: 1.0 2016 | } 2017 | bias_term: true 2018 | bias_filler { 2019 | type: "constant" 2020 | value: 0.0 2021 | } 2022 | } 2023 | } 2024 | layer { 2025 | name: "stage_3_3/conv3/relu" 2026 | type: "ReLU" 2027 | bottom: "stage_3_3/conv3" 2028 | top: "stage_3_3/conv3" 2029 | } 2030 | layer { 2031 | name: "stage_3_3/concat" 2032 | type: "Concat" 2033 | bottom: "stage_3_3/slice1" 2034 | bottom: "stage_3_3/conv3" 2035 | top: "stage_3_3/concat" 2036 | concat_param { 2037 | axis: 1 2038 | } 2039 | } 2040 | layer { 2041 | name: "stage_3_3/shuffle" 2042 | type: "ShuffleChannel" 2043 | bottom: "stage_3_3/concat" 2044 | top: "stage_3_3/shuffle" 2045 | shuffle_channel_param { 2046 | group: 2 2047 | } 2048 | } 2049 | layer { 2050 | name: "stage_3_4/slice1" 2051 | type: "Slice" 2052 | bottom: "stage_3_3/shuffle" 2053 | top: "stage_3_4/slice1" 2054 | top: "stage_3_4/slice2" 2055 | slice_param { 2056 | slice_point: 48 2057 | axis: 1 2058 | } 2059 | } 2060 | layer { 2061 | name: "stage_3_4/conv1" 2062 | type: "Convolution" 2063 | bottom: "stage_3_4/slice2" 2064 | top: "stage_3_4/conv1" 2065 | param { 2066 | lr_mult: 1.0 2067 | decay_mult: 1.0 2068 | } 2069 | convolution_param { 2070 | num_output: 48 2071 | bias_term: false 2072 | pad: 0 2073 | kernel_size: 1 2074 | group: 1 2075 | stride: 1 2076 | weight_filler { 2077 | type: "msra" 2078 | } 2079 | dilation: 1 2080 | } 2081 | } 2082 | layer { 2083 | name: "stage_3_4/conv1/bn" 2084 | type: "BatchNorm" 2085 | bottom: "stage_3_4/conv1" 2086 | top: "stage_3_4/conv1" 2087 | param { 2088 | lr_mult: 0.0 2089 | decay_mult: 0.0 2090 | } 2091 | param { 2092 | lr_mult: 0.0 2093 | decay_mult: 0.0 2094 | } 2095 | param { 2096 | lr_mult: 0.0 2097 | decay_mult: 0.0 2098 | } 2099 | } 2100 | layer { 2101 | name: "stage_3_4/conv1/bn/scale" 2102 | type: "Scale" 2103 | bottom: "stage_3_4/conv1" 2104 | top: "stage_3_4/conv1" 2105 | param { 2106 | lr_mult: 1.0 2107 | decay_mult: 0.0 2108 | } 2109 | param { 2110 | lr_mult: 1.0 2111 | decay_mult: 0.0 2112 | } 2113 | scale_param { 2114 | filler { 2115 | type: "constant" 2116 | value: 1.0 2117 | } 2118 | bias_term: true 2119 | bias_filler { 2120 | type: "constant" 2121 | value: 0.0 2122 | } 2123 | } 2124 | } 2125 | layer { 2126 | name: "stage_3_4/conv1/relu" 2127 | type: "ReLU" 2128 | bottom: "stage_3_4/conv1" 2129 | top: "stage_3_4/conv1" 2130 | } 2131 | layer { 2132 | name: "stage_3_4/conv2" 2133 | type: "Convolution" 2134 | bottom: "stage_3_4/conv1" 2135 | top: "stage_3_4/conv2" 2136 | param { 2137 | lr_mult: 1.0 2138 | decay_mult: 1.0 2139 | } 2140 | convolution_param { 2141 | num_output: 48 2142 | bias_term: false 2143 | pad: 1 2144 | kernel_size: 3 2145 | group: 48 2146 | stride: 1 2147 | weight_filler { 2148 | type: "msra" 2149 | } 2150 | dilation: 1 2151 | } 2152 | } 2153 | layer { 2154 | name: "stage_3_4/conv2/bn" 2155 | type: "BatchNorm" 2156 | bottom: "stage_3_4/conv2" 2157 | top: "stage_3_4/conv2" 2158 | param { 2159 | lr_mult: 0.0 2160 | decay_mult: 0.0 2161 | } 2162 | param { 2163 | lr_mult: 0.0 2164 | decay_mult: 0.0 2165 | } 2166 | param { 2167 | lr_mult: 0.0 2168 | decay_mult: 0.0 2169 | } 2170 | } 2171 | layer { 2172 | name: "stage_3_4/conv2/bn/scale" 2173 | type: "Scale" 2174 | bottom: "stage_3_4/conv2" 2175 | top: "stage_3_4/conv2" 2176 | param { 2177 | lr_mult: 1.0 2178 | decay_mult: 0.0 2179 | } 2180 | param { 2181 | lr_mult: 1.0 2182 | decay_mult: 0.0 2183 | } 2184 | scale_param { 2185 | filler { 2186 | type: "constant" 2187 | value: 1.0 2188 | } 2189 | bias_term: true 2190 | bias_filler { 2191 | type: "constant" 2192 | value: 0.0 2193 | } 2194 | } 2195 | } 2196 | layer { 2197 | name: "stage_3_4/conv3" 2198 | type: "Convolution" 2199 | bottom: "stage_3_4/conv2" 2200 | top: "stage_3_4/conv3" 2201 | param { 2202 | lr_mult: 1.0 2203 | decay_mult: 1.0 2204 | } 2205 | convolution_param { 2206 | num_output: 48 2207 | bias_term: false 2208 | pad: 0 2209 | kernel_size: 1 2210 | group: 1 2211 | stride: 1 2212 | weight_filler { 2213 | type: "msra" 2214 | } 2215 | dilation: 1 2216 | } 2217 | } 2218 | layer { 2219 | name: "stage_3_4/conv3/bn" 2220 | type: "BatchNorm" 2221 | bottom: "stage_3_4/conv3" 2222 | top: "stage_3_4/conv3" 2223 | param { 2224 | lr_mult: 0.0 2225 | decay_mult: 0.0 2226 | } 2227 | param { 2228 | lr_mult: 0.0 2229 | decay_mult: 0.0 2230 | } 2231 | param { 2232 | lr_mult: 0.0 2233 | decay_mult: 0.0 2234 | } 2235 | } 2236 | layer { 2237 | name: "stage_3_4/conv3/bn/scale" 2238 | type: "Scale" 2239 | bottom: "stage_3_4/conv3" 2240 | top: "stage_3_4/conv3" 2241 | param { 2242 | lr_mult: 1.0 2243 | decay_mult: 0.0 2244 | } 2245 | param { 2246 | lr_mult: 1.0 2247 | decay_mult: 0.0 2248 | } 2249 | scale_param { 2250 | filler { 2251 | type: "constant" 2252 | value: 1.0 2253 | } 2254 | bias_term: true 2255 | bias_filler { 2256 | type: "constant" 2257 | value: 0.0 2258 | } 2259 | } 2260 | } 2261 | layer { 2262 | name: "stage_3_4/conv3/relu" 2263 | type: "ReLU" 2264 | bottom: "stage_3_4/conv3" 2265 | top: "stage_3_4/conv3" 2266 | } 2267 | layer { 2268 | name: "stage_3_4/concat" 2269 | type: "Concat" 2270 | bottom: "stage_3_4/slice1" 2271 | bottom: "stage_3_4/conv3" 2272 | top: "stage_3_4/concat" 2273 | concat_param { 2274 | axis: 1 2275 | } 2276 | } 2277 | layer { 2278 | name: "stage_3_4/shuffle" 2279 | type: "ShuffleChannel" 2280 | bottom: "stage_3_4/concat" 2281 | top: "stage_3_4/shuffle" 2282 | shuffle_channel_param { 2283 | group: 2 2284 | } 2285 | } 2286 | layer { 2287 | name: "stage_3_5/slice1" 2288 | type: "Slice" 2289 | bottom: "stage_3_4/shuffle" 2290 | top: "stage_3_5/slice1" 2291 | top: "stage_3_5/slice2" 2292 | slice_param { 2293 | slice_point: 48 2294 | axis: 1 2295 | } 2296 | } 2297 | layer { 2298 | name: "stage_3_5/conv1" 2299 | type: "Convolution" 2300 | bottom: "stage_3_5/slice2" 2301 | top: "stage_3_5/conv1" 2302 | param { 2303 | lr_mult: 1.0 2304 | decay_mult: 1.0 2305 | } 2306 | convolution_param { 2307 | num_output: 48 2308 | bias_term: false 2309 | pad: 0 2310 | kernel_size: 1 2311 | group: 1 2312 | stride: 1 2313 | weight_filler { 2314 | type: "msra" 2315 | } 2316 | dilation: 1 2317 | } 2318 | } 2319 | layer { 2320 | name: "stage_3_5/conv1/bn" 2321 | type: "BatchNorm" 2322 | bottom: "stage_3_5/conv1" 2323 | top: "stage_3_5/conv1" 2324 | param { 2325 | lr_mult: 0.0 2326 | decay_mult: 0.0 2327 | } 2328 | param { 2329 | lr_mult: 0.0 2330 | decay_mult: 0.0 2331 | } 2332 | param { 2333 | lr_mult: 0.0 2334 | decay_mult: 0.0 2335 | } 2336 | } 2337 | layer { 2338 | name: "stage_3_5/conv1/bn/scale" 2339 | type: "Scale" 2340 | bottom: "stage_3_5/conv1" 2341 | top: "stage_3_5/conv1" 2342 | param { 2343 | lr_mult: 1.0 2344 | decay_mult: 0.0 2345 | } 2346 | param { 2347 | lr_mult: 1.0 2348 | decay_mult: 0.0 2349 | } 2350 | scale_param { 2351 | filler { 2352 | type: "constant" 2353 | value: 1.0 2354 | } 2355 | bias_term: true 2356 | bias_filler { 2357 | type: "constant" 2358 | value: 0.0 2359 | } 2360 | } 2361 | } 2362 | layer { 2363 | name: "stage_3_5/conv1/relu" 2364 | type: "ReLU" 2365 | bottom: "stage_3_5/conv1" 2366 | top: "stage_3_5/conv1" 2367 | } 2368 | layer { 2369 | name: "stage_3_5/conv2" 2370 | type: "Convolution" 2371 | bottom: "stage_3_5/conv1" 2372 | top: "stage_3_5/conv2" 2373 | param { 2374 | lr_mult: 1.0 2375 | decay_mult: 1.0 2376 | } 2377 | convolution_param { 2378 | num_output: 48 2379 | bias_term: false 2380 | pad: 1 2381 | kernel_size: 3 2382 | group: 48 2383 | stride: 1 2384 | weight_filler { 2385 | type: "msra" 2386 | } 2387 | dilation: 1 2388 | } 2389 | } 2390 | layer { 2391 | name: "stage_3_5/conv2/bn" 2392 | type: "BatchNorm" 2393 | bottom: "stage_3_5/conv2" 2394 | top: "stage_3_5/conv2" 2395 | param { 2396 | lr_mult: 0.0 2397 | decay_mult: 0.0 2398 | } 2399 | param { 2400 | lr_mult: 0.0 2401 | decay_mult: 0.0 2402 | } 2403 | param { 2404 | lr_mult: 0.0 2405 | decay_mult: 0.0 2406 | } 2407 | } 2408 | layer { 2409 | name: "stage_3_5/conv2/bn/scale" 2410 | type: "Scale" 2411 | bottom: "stage_3_5/conv2" 2412 | top: "stage_3_5/conv2" 2413 | param { 2414 | lr_mult: 1.0 2415 | decay_mult: 0.0 2416 | } 2417 | param { 2418 | lr_mult: 1.0 2419 | decay_mult: 0.0 2420 | } 2421 | scale_param { 2422 | filler { 2423 | type: "constant" 2424 | value: 1.0 2425 | } 2426 | bias_term: true 2427 | bias_filler { 2428 | type: "constant" 2429 | value: 0.0 2430 | } 2431 | } 2432 | } 2433 | layer { 2434 | name: "stage_3_5/conv3" 2435 | type: "Convolution" 2436 | bottom: "stage_3_5/conv2" 2437 | top: "stage_3_5/conv3" 2438 | param { 2439 | lr_mult: 1.0 2440 | decay_mult: 1.0 2441 | } 2442 | convolution_param { 2443 | num_output: 48 2444 | bias_term: false 2445 | pad: 0 2446 | kernel_size: 1 2447 | group: 1 2448 | stride: 1 2449 | weight_filler { 2450 | type: "msra" 2451 | } 2452 | dilation: 1 2453 | } 2454 | } 2455 | layer { 2456 | name: "stage_3_5/conv3/bn" 2457 | type: "BatchNorm" 2458 | bottom: "stage_3_5/conv3" 2459 | top: "stage_3_5/conv3" 2460 | param { 2461 | lr_mult: 0.0 2462 | decay_mult: 0.0 2463 | } 2464 | param { 2465 | lr_mult: 0.0 2466 | decay_mult: 0.0 2467 | } 2468 | param { 2469 | lr_mult: 0.0 2470 | decay_mult: 0.0 2471 | } 2472 | } 2473 | layer { 2474 | name: "stage_3_5/conv3/bn/scale" 2475 | type: "Scale" 2476 | bottom: "stage_3_5/conv3" 2477 | top: "stage_3_5/conv3" 2478 | param { 2479 | lr_mult: 1.0 2480 | decay_mult: 0.0 2481 | } 2482 | param { 2483 | lr_mult: 1.0 2484 | decay_mult: 0.0 2485 | } 2486 | scale_param { 2487 | filler { 2488 | type: "constant" 2489 | value: 1.0 2490 | } 2491 | bias_term: true 2492 | bias_filler { 2493 | type: "constant" 2494 | value: 0.0 2495 | } 2496 | } 2497 | } 2498 | layer { 2499 | name: "stage_3_5/conv3/relu" 2500 | type: "ReLU" 2501 | bottom: "stage_3_5/conv3" 2502 | top: "stage_3_5/conv3" 2503 | } 2504 | layer { 2505 | name: "stage_3_5/concat" 2506 | type: "Concat" 2507 | bottom: "stage_3_5/slice1" 2508 | bottom: "stage_3_5/conv3" 2509 | top: "stage_3_5/concat" 2510 | concat_param { 2511 | axis: 1 2512 | } 2513 | } 2514 | layer { 2515 | name: "stage_3_5/shuffle" 2516 | type: "ShuffleChannel" 2517 | bottom: "stage_3_5/concat" 2518 | top: "stage_3_5/shuffle" 2519 | shuffle_channel_param { 2520 | group: 2 2521 | } 2522 | } 2523 | layer { 2524 | name: "stage_3_6/slice1" 2525 | type: "Slice" 2526 | bottom: "stage_3_5/shuffle" 2527 | top: "stage_3_6/slice1" 2528 | top: "stage_3_6/slice2" 2529 | slice_param { 2530 | slice_point: 48 2531 | axis: 1 2532 | } 2533 | } 2534 | layer { 2535 | name: "stage_3_6/conv1" 2536 | type: "Convolution" 2537 | bottom: "stage_3_6/slice2" 2538 | top: "stage_3_6/conv1" 2539 | param { 2540 | lr_mult: 1.0 2541 | decay_mult: 1.0 2542 | } 2543 | convolution_param { 2544 | num_output: 48 2545 | bias_term: false 2546 | pad: 0 2547 | kernel_size: 1 2548 | group: 1 2549 | stride: 1 2550 | weight_filler { 2551 | type: "msra" 2552 | } 2553 | dilation: 1 2554 | } 2555 | } 2556 | layer { 2557 | name: "stage_3_6/conv1/bn" 2558 | type: "BatchNorm" 2559 | bottom: "stage_3_6/conv1" 2560 | top: "stage_3_6/conv1" 2561 | param { 2562 | lr_mult: 0.0 2563 | decay_mult: 0.0 2564 | } 2565 | param { 2566 | lr_mult: 0.0 2567 | decay_mult: 0.0 2568 | } 2569 | param { 2570 | lr_mult: 0.0 2571 | decay_mult: 0.0 2572 | } 2573 | } 2574 | layer { 2575 | name: "stage_3_6/conv1/bn/scale" 2576 | type: "Scale" 2577 | bottom: "stage_3_6/conv1" 2578 | top: "stage_3_6/conv1" 2579 | param { 2580 | lr_mult: 1.0 2581 | decay_mult: 0.0 2582 | } 2583 | param { 2584 | lr_mult: 1.0 2585 | decay_mult: 0.0 2586 | } 2587 | scale_param { 2588 | filler { 2589 | type: "constant" 2590 | value: 1.0 2591 | } 2592 | bias_term: true 2593 | bias_filler { 2594 | type: "constant" 2595 | value: 0.0 2596 | } 2597 | } 2598 | } 2599 | layer { 2600 | name: "stage_3_6/conv1/relu" 2601 | type: "ReLU" 2602 | bottom: "stage_3_6/conv1" 2603 | top: "stage_3_6/conv1" 2604 | } 2605 | layer { 2606 | name: "stage_3_6/conv2" 2607 | type: "Convolution" 2608 | bottom: "stage_3_6/conv1" 2609 | top: "stage_3_6/conv2" 2610 | param { 2611 | lr_mult: 1.0 2612 | decay_mult: 1.0 2613 | } 2614 | convolution_param { 2615 | num_output: 48 2616 | bias_term: false 2617 | pad: 1 2618 | kernel_size: 3 2619 | group: 48 2620 | stride: 1 2621 | weight_filler { 2622 | type: "msra" 2623 | } 2624 | dilation: 1 2625 | } 2626 | } 2627 | layer { 2628 | name: "stage_3_6/conv2/bn" 2629 | type: "BatchNorm" 2630 | bottom: "stage_3_6/conv2" 2631 | top: "stage_3_6/conv2" 2632 | param { 2633 | lr_mult: 0.0 2634 | decay_mult: 0.0 2635 | } 2636 | param { 2637 | lr_mult: 0.0 2638 | decay_mult: 0.0 2639 | } 2640 | param { 2641 | lr_mult: 0.0 2642 | decay_mult: 0.0 2643 | } 2644 | } 2645 | layer { 2646 | name: "stage_3_6/conv2/bn/scale" 2647 | type: "Scale" 2648 | bottom: "stage_3_6/conv2" 2649 | top: "stage_3_6/conv2" 2650 | param { 2651 | lr_mult: 1.0 2652 | decay_mult: 0.0 2653 | } 2654 | param { 2655 | lr_mult: 1.0 2656 | decay_mult: 0.0 2657 | } 2658 | scale_param { 2659 | filler { 2660 | type: "constant" 2661 | value: 1.0 2662 | } 2663 | bias_term: true 2664 | bias_filler { 2665 | type: "constant" 2666 | value: 0.0 2667 | } 2668 | } 2669 | } 2670 | layer { 2671 | name: "stage_3_6/conv3" 2672 | type: "Convolution" 2673 | bottom: "stage_3_6/conv2" 2674 | top: "stage_3_6/conv3" 2675 | param { 2676 | lr_mult: 1.0 2677 | decay_mult: 1.0 2678 | } 2679 | convolution_param { 2680 | num_output: 48 2681 | bias_term: false 2682 | pad: 0 2683 | kernel_size: 1 2684 | group: 1 2685 | stride: 1 2686 | weight_filler { 2687 | type: "msra" 2688 | } 2689 | dilation: 1 2690 | } 2691 | } 2692 | layer { 2693 | name: "stage_3_6/conv3/bn" 2694 | type: "BatchNorm" 2695 | bottom: "stage_3_6/conv3" 2696 | top: "stage_3_6/conv3" 2697 | param { 2698 | lr_mult: 0.0 2699 | decay_mult: 0.0 2700 | } 2701 | param { 2702 | lr_mult: 0.0 2703 | decay_mult: 0.0 2704 | } 2705 | param { 2706 | lr_mult: 0.0 2707 | decay_mult: 0.0 2708 | } 2709 | } 2710 | layer { 2711 | name: "stage_3_6/conv3/bn/scale" 2712 | type: "Scale" 2713 | bottom: "stage_3_6/conv3" 2714 | top: "stage_3_6/conv3" 2715 | param { 2716 | lr_mult: 1.0 2717 | decay_mult: 0.0 2718 | } 2719 | param { 2720 | lr_mult: 1.0 2721 | decay_mult: 0.0 2722 | } 2723 | scale_param { 2724 | filler { 2725 | type: "constant" 2726 | value: 1.0 2727 | } 2728 | bias_term: true 2729 | bias_filler { 2730 | type: "constant" 2731 | value: 0.0 2732 | } 2733 | } 2734 | } 2735 | layer { 2736 | name: "stage_3_6/conv3/relu" 2737 | type: "ReLU" 2738 | bottom: "stage_3_6/conv3" 2739 | top: "stage_3_6/conv3" 2740 | } 2741 | layer { 2742 | name: "stage_3_6/concat" 2743 | type: "Concat" 2744 | bottom: "stage_3_6/slice1" 2745 | bottom: "stage_3_6/conv3" 2746 | top: "stage_3_6/concat" 2747 | concat_param { 2748 | axis: 1 2749 | } 2750 | } 2751 | layer { 2752 | name: "stage_3_6/shuffle" 2753 | type: "ShuffleChannel" 2754 | bottom: "stage_3_6/concat" 2755 | top: "stage_3_6/shuffle" 2756 | shuffle_channel_param { 2757 | group: 2 2758 | } 2759 | } 2760 | layer { 2761 | name: "stage_3_7/slice1" 2762 | type: "Slice" 2763 | bottom: "stage_3_6/shuffle" 2764 | top: "stage_3_7/slice1" 2765 | top: "stage_3_7/slice2" 2766 | slice_param { 2767 | slice_point: 48 2768 | axis: 1 2769 | } 2770 | } 2771 | layer { 2772 | name: "stage_3_7/conv1" 2773 | type: "Convolution" 2774 | bottom: "stage_3_7/slice2" 2775 | top: "stage_3_7/conv1" 2776 | param { 2777 | lr_mult: 1.0 2778 | decay_mult: 1.0 2779 | } 2780 | convolution_param { 2781 | num_output: 48 2782 | bias_term: false 2783 | pad: 0 2784 | kernel_size: 1 2785 | group: 1 2786 | stride: 1 2787 | weight_filler { 2788 | type: "msra" 2789 | } 2790 | dilation: 1 2791 | } 2792 | } 2793 | layer { 2794 | name: "stage_3_7/conv1/bn" 2795 | type: "BatchNorm" 2796 | bottom: "stage_3_7/conv1" 2797 | top: "stage_3_7/conv1" 2798 | param { 2799 | lr_mult: 0.0 2800 | decay_mult: 0.0 2801 | } 2802 | param { 2803 | lr_mult: 0.0 2804 | decay_mult: 0.0 2805 | } 2806 | param { 2807 | lr_mult: 0.0 2808 | decay_mult: 0.0 2809 | } 2810 | } 2811 | layer { 2812 | name: "stage_3_7/conv1/bn/scale" 2813 | type: "Scale" 2814 | bottom: "stage_3_7/conv1" 2815 | top: "stage_3_7/conv1" 2816 | param { 2817 | lr_mult: 1.0 2818 | decay_mult: 0.0 2819 | } 2820 | param { 2821 | lr_mult: 1.0 2822 | decay_mult: 0.0 2823 | } 2824 | scale_param { 2825 | filler { 2826 | type: "constant" 2827 | value: 1.0 2828 | } 2829 | bias_term: true 2830 | bias_filler { 2831 | type: "constant" 2832 | value: 0.0 2833 | } 2834 | } 2835 | } 2836 | layer { 2837 | name: "stage_3_7/conv1/relu" 2838 | type: "ReLU" 2839 | bottom: "stage_3_7/conv1" 2840 | top: "stage_3_7/conv1" 2841 | } 2842 | layer { 2843 | name: "stage_3_7/conv2" 2844 | type: "Convolution" 2845 | bottom: "stage_3_7/conv1" 2846 | top: "stage_3_7/conv2" 2847 | param { 2848 | lr_mult: 1.0 2849 | decay_mult: 1.0 2850 | } 2851 | convolution_param { 2852 | num_output: 48 2853 | bias_term: false 2854 | pad: 1 2855 | kernel_size: 3 2856 | group: 48 2857 | stride: 1 2858 | weight_filler { 2859 | type: "msra" 2860 | } 2861 | dilation: 1 2862 | } 2863 | } 2864 | layer { 2865 | name: "stage_3_7/conv2/bn" 2866 | type: "BatchNorm" 2867 | bottom: "stage_3_7/conv2" 2868 | top: "stage_3_7/conv2" 2869 | param { 2870 | lr_mult: 0.0 2871 | decay_mult: 0.0 2872 | } 2873 | param { 2874 | lr_mult: 0.0 2875 | decay_mult: 0.0 2876 | } 2877 | param { 2878 | lr_mult: 0.0 2879 | decay_mult: 0.0 2880 | } 2881 | } 2882 | layer { 2883 | name: "stage_3_7/conv2/bn/scale" 2884 | type: "Scale" 2885 | bottom: "stage_3_7/conv2" 2886 | top: "stage_3_7/conv2" 2887 | param { 2888 | lr_mult: 1.0 2889 | decay_mult: 0.0 2890 | } 2891 | param { 2892 | lr_mult: 1.0 2893 | decay_mult: 0.0 2894 | } 2895 | scale_param { 2896 | filler { 2897 | type: "constant" 2898 | value: 1.0 2899 | } 2900 | bias_term: true 2901 | bias_filler { 2902 | type: "constant" 2903 | value: 0.0 2904 | } 2905 | } 2906 | } 2907 | layer { 2908 | name: "stage_3_7/conv3" 2909 | type: "Convolution" 2910 | bottom: "stage_3_7/conv2" 2911 | top: "stage_3_7/conv3" 2912 | param { 2913 | lr_mult: 1.0 2914 | decay_mult: 1.0 2915 | } 2916 | convolution_param { 2917 | num_output: 48 2918 | bias_term: false 2919 | pad: 0 2920 | kernel_size: 1 2921 | group: 1 2922 | stride: 1 2923 | weight_filler { 2924 | type: "msra" 2925 | } 2926 | dilation: 1 2927 | } 2928 | } 2929 | layer { 2930 | name: "stage_3_7/conv3/bn" 2931 | type: "BatchNorm" 2932 | bottom: "stage_3_7/conv3" 2933 | top: "stage_3_7/conv3" 2934 | param { 2935 | lr_mult: 0.0 2936 | decay_mult: 0.0 2937 | } 2938 | param { 2939 | lr_mult: 0.0 2940 | decay_mult: 0.0 2941 | } 2942 | param { 2943 | lr_mult: 0.0 2944 | decay_mult: 0.0 2945 | } 2946 | } 2947 | layer { 2948 | name: "stage_3_7/conv3/bn/scale" 2949 | type: "Scale" 2950 | bottom: "stage_3_7/conv3" 2951 | top: "stage_3_7/conv3" 2952 | param { 2953 | lr_mult: 1.0 2954 | decay_mult: 0.0 2955 | } 2956 | param { 2957 | lr_mult: 1.0 2958 | decay_mult: 0.0 2959 | } 2960 | scale_param { 2961 | filler { 2962 | type: "constant" 2963 | value: 1.0 2964 | } 2965 | bias_term: true 2966 | bias_filler { 2967 | type: "constant" 2968 | value: 0.0 2969 | } 2970 | } 2971 | } 2972 | layer { 2973 | name: "stage_3_7/conv3/relu" 2974 | type: "ReLU" 2975 | bottom: "stage_3_7/conv3" 2976 | top: "stage_3_7/conv3" 2977 | } 2978 | layer { 2979 | name: "stage_3_7/concat" 2980 | type: "Concat" 2981 | bottom: "stage_3_7/slice1" 2982 | bottom: "stage_3_7/conv3" 2983 | top: "stage_3_7/concat" 2984 | concat_param { 2985 | axis: 1 2986 | } 2987 | } 2988 | layer { 2989 | name: "stage_3_7/shuffle" 2990 | type: "ShuffleChannel" 2991 | bottom: "stage_3_7/concat" 2992 | top: "stage_3_7/shuffle" 2993 | shuffle_channel_param { 2994 | group: 2 2995 | } 2996 | } 2997 | layer { 2998 | name: "stage_3_8/slice1" 2999 | type: "Slice" 3000 | bottom: "stage_3_7/shuffle" 3001 | top: "stage_3_8/slice1" 3002 | top: "stage_3_8/slice2" 3003 | slice_param { 3004 | slice_point: 48 3005 | axis: 1 3006 | } 3007 | } 3008 | layer { 3009 | name: "stage_3_8/conv1" 3010 | type: "Convolution" 3011 | bottom: "stage_3_8/slice2" 3012 | top: "stage_3_8/conv1" 3013 | param { 3014 | lr_mult: 1.0 3015 | decay_mult: 1.0 3016 | } 3017 | convolution_param { 3018 | num_output: 48 3019 | bias_term: false 3020 | pad: 0 3021 | kernel_size: 1 3022 | group: 1 3023 | stride: 1 3024 | weight_filler { 3025 | type: "msra" 3026 | } 3027 | dilation: 1 3028 | } 3029 | } 3030 | layer { 3031 | name: "stage_3_8/conv1/bn" 3032 | type: "BatchNorm" 3033 | bottom: "stage_3_8/conv1" 3034 | top: "stage_3_8/conv1" 3035 | param { 3036 | lr_mult: 0.0 3037 | decay_mult: 0.0 3038 | } 3039 | param { 3040 | lr_mult: 0.0 3041 | decay_mult: 0.0 3042 | } 3043 | param { 3044 | lr_mult: 0.0 3045 | decay_mult: 0.0 3046 | } 3047 | } 3048 | layer { 3049 | name: "stage_3_8/conv1/bn/scale" 3050 | type: "Scale" 3051 | bottom: "stage_3_8/conv1" 3052 | top: "stage_3_8/conv1" 3053 | param { 3054 | lr_mult: 1.0 3055 | decay_mult: 0.0 3056 | } 3057 | param { 3058 | lr_mult: 1.0 3059 | decay_mult: 0.0 3060 | } 3061 | scale_param { 3062 | filler { 3063 | type: "constant" 3064 | value: 1.0 3065 | } 3066 | bias_term: true 3067 | bias_filler { 3068 | type: "constant" 3069 | value: 0.0 3070 | } 3071 | } 3072 | } 3073 | layer { 3074 | name: "stage_3_8/conv1/relu" 3075 | type: "ReLU" 3076 | bottom: "stage_3_8/conv1" 3077 | top: "stage_3_8/conv1" 3078 | } 3079 | layer { 3080 | name: "stage_3_8/conv2" 3081 | type: "Convolution" 3082 | bottom: "stage_3_8/conv1" 3083 | top: "stage_3_8/conv2" 3084 | param { 3085 | lr_mult: 1.0 3086 | decay_mult: 1.0 3087 | } 3088 | convolution_param { 3089 | num_output: 48 3090 | bias_term: false 3091 | pad: 1 3092 | kernel_size: 3 3093 | group: 48 3094 | stride: 1 3095 | weight_filler { 3096 | type: "msra" 3097 | } 3098 | dilation: 1 3099 | } 3100 | } 3101 | layer { 3102 | name: "stage_3_8/conv2/bn" 3103 | type: "BatchNorm" 3104 | bottom: "stage_3_8/conv2" 3105 | top: "stage_3_8/conv2" 3106 | param { 3107 | lr_mult: 0.0 3108 | decay_mult: 0.0 3109 | } 3110 | param { 3111 | lr_mult: 0.0 3112 | decay_mult: 0.0 3113 | } 3114 | param { 3115 | lr_mult: 0.0 3116 | decay_mult: 0.0 3117 | } 3118 | } 3119 | layer { 3120 | name: "stage_3_8/conv2/bn/scale" 3121 | type: "Scale" 3122 | bottom: "stage_3_8/conv2" 3123 | top: "stage_3_8/conv2" 3124 | param { 3125 | lr_mult: 1.0 3126 | decay_mult: 0.0 3127 | } 3128 | param { 3129 | lr_mult: 1.0 3130 | decay_mult: 0.0 3131 | } 3132 | scale_param { 3133 | filler { 3134 | type: "constant" 3135 | value: 1.0 3136 | } 3137 | bias_term: true 3138 | bias_filler { 3139 | type: "constant" 3140 | value: 0.0 3141 | } 3142 | } 3143 | } 3144 | layer { 3145 | name: "stage_3_8/conv3" 3146 | type: "Convolution" 3147 | bottom: "stage_3_8/conv2" 3148 | top: "stage_3_8/conv3" 3149 | param { 3150 | lr_mult: 1.0 3151 | decay_mult: 1.0 3152 | } 3153 | convolution_param { 3154 | num_output: 48 3155 | bias_term: false 3156 | pad: 0 3157 | kernel_size: 1 3158 | group: 1 3159 | stride: 1 3160 | weight_filler { 3161 | type: "msra" 3162 | } 3163 | dilation: 1 3164 | } 3165 | } 3166 | layer { 3167 | name: "stage_3_8/conv3/bn" 3168 | type: "BatchNorm" 3169 | bottom: "stage_3_8/conv3" 3170 | top: "stage_3_8/conv3" 3171 | param { 3172 | lr_mult: 0.0 3173 | decay_mult: 0.0 3174 | } 3175 | param { 3176 | lr_mult: 0.0 3177 | decay_mult: 0.0 3178 | } 3179 | param { 3180 | lr_mult: 0.0 3181 | decay_mult: 0.0 3182 | } 3183 | } 3184 | layer { 3185 | name: "stage_3_8/conv3/bn/scale" 3186 | type: "Scale" 3187 | bottom: "stage_3_8/conv3" 3188 | top: "stage_3_8/conv3" 3189 | param { 3190 | lr_mult: 1.0 3191 | decay_mult: 0.0 3192 | } 3193 | param { 3194 | lr_mult: 1.0 3195 | decay_mult: 0.0 3196 | } 3197 | scale_param { 3198 | filler { 3199 | type: "constant" 3200 | value: 1.0 3201 | } 3202 | bias_term: true 3203 | bias_filler { 3204 | type: "constant" 3205 | value: 0.0 3206 | } 3207 | } 3208 | } 3209 | layer { 3210 | name: "stage_3_8/conv3/relu" 3211 | type: "ReLU" 3212 | bottom: "stage_3_8/conv3" 3213 | top: "stage_3_8/conv3" 3214 | } 3215 | layer { 3216 | name: "stage_3_8/concat" 3217 | type: "Concat" 3218 | bottom: "stage_3_8/slice1" 3219 | bottom: "stage_3_8/conv3" 3220 | top: "stage_3_8/concat" 3221 | concat_param { 3222 | axis: 1 3223 | } 3224 | } 3225 | layer { 3226 | name: "stage_3_8/shuffle" 3227 | type: "ShuffleChannel" 3228 | bottom: "stage_3_8/concat" 3229 | top: "stage_3_8/shuffle" 3230 | shuffle_channel_param { 3231 | group: 2 3232 | } 3233 | } 3234 | layer { 3235 | name: "stage_4_1/conv4" 3236 | type: "Convolution" 3237 | bottom: "stage_3_8/shuffle" 3238 | top: "stage_4_1/conv4" 3239 | param { 3240 | lr_mult: 1.0 3241 | decay_mult: 1.0 3242 | } 3243 | convolution_param { 3244 | num_output: 96 3245 | bias_term: false 3246 | pad: 1 3247 | kernel_size: 3 3248 | group: 96 3249 | stride: 2 3250 | weight_filler { 3251 | type: "msra" 3252 | } 3253 | dilation: 1 3254 | } 3255 | } 3256 | layer { 3257 | name: "stage_4_1/conv4/bn" 3258 | type: "BatchNorm" 3259 | bottom: "stage_4_1/conv4" 3260 | top: "stage_4_1/conv4" 3261 | param { 3262 | lr_mult: 0.0 3263 | decay_mult: 0.0 3264 | } 3265 | param { 3266 | lr_mult: 0.0 3267 | decay_mult: 0.0 3268 | } 3269 | param { 3270 | lr_mult: 0.0 3271 | decay_mult: 0.0 3272 | } 3273 | } 3274 | layer { 3275 | name: "stage_4_1/conv4/bn/scale" 3276 | type: "Scale" 3277 | bottom: "stage_4_1/conv4" 3278 | top: "stage_4_1/conv4" 3279 | param { 3280 | lr_mult: 1.0 3281 | decay_mult: 0.0 3282 | } 3283 | param { 3284 | lr_mult: 1.0 3285 | decay_mult: 0.0 3286 | } 3287 | scale_param { 3288 | filler { 3289 | type: "constant" 3290 | value: 1.0 3291 | } 3292 | bias_term: true 3293 | bias_filler { 3294 | type: "constant" 3295 | value: 0.0 3296 | } 3297 | } 3298 | } 3299 | layer { 3300 | name: "stage_4_1/conv5" 3301 | type: "Convolution" 3302 | bottom: "stage_4_1/conv4" 3303 | top: "stage_4_1/conv5" 3304 | param { 3305 | lr_mult: 1.0 3306 | decay_mult: 1.0 3307 | } 3308 | convolution_param { 3309 | num_output: 96 3310 | bias_term: false 3311 | pad: 0 3312 | kernel_size: 1 3313 | group: 1 3314 | stride: 1 3315 | weight_filler { 3316 | type: "msra" 3317 | } 3318 | dilation: 1 3319 | } 3320 | } 3321 | layer { 3322 | name: "stage_4_1/conv5/bn" 3323 | type: "BatchNorm" 3324 | bottom: "stage_4_1/conv5" 3325 | top: "stage_4_1/conv5" 3326 | param { 3327 | lr_mult: 0.0 3328 | decay_mult: 0.0 3329 | } 3330 | param { 3331 | lr_mult: 0.0 3332 | decay_mult: 0.0 3333 | } 3334 | param { 3335 | lr_mult: 0.0 3336 | decay_mult: 0.0 3337 | } 3338 | } 3339 | layer { 3340 | name: "stage_4_1/conv5/bn/scale" 3341 | type: "Scale" 3342 | bottom: "stage_4_1/conv5" 3343 | top: "stage_4_1/conv5" 3344 | param { 3345 | lr_mult: 1.0 3346 | decay_mult: 0.0 3347 | } 3348 | param { 3349 | lr_mult: 1.0 3350 | decay_mult: 0.0 3351 | } 3352 | scale_param { 3353 | filler { 3354 | type: "constant" 3355 | value: 1.0 3356 | } 3357 | bias_term: true 3358 | bias_filler { 3359 | type: "constant" 3360 | value: 0.0 3361 | } 3362 | } 3363 | } 3364 | layer { 3365 | name: "stage_4_1/conv5/relu" 3366 | type: "ReLU" 3367 | bottom: "stage_4_1/conv5" 3368 | top: "stage_4_1/conv5" 3369 | } 3370 | layer { 3371 | name: "stage_4_1/conv1" 3372 | type: "Convolution" 3373 | bottom: "stage_3_8/shuffle" 3374 | top: "stage_4_1/conv1" 3375 | param { 3376 | lr_mult: 1.0 3377 | decay_mult: 1.0 3378 | } 3379 | convolution_param { 3380 | num_output: 96 3381 | bias_term: false 3382 | pad: 0 3383 | kernel_size: 1 3384 | group: 1 3385 | stride: 1 3386 | weight_filler { 3387 | type: "msra" 3388 | } 3389 | dilation: 1 3390 | } 3391 | } 3392 | layer { 3393 | name: "stage_4_1/conv1/bn" 3394 | type: "BatchNorm" 3395 | bottom: "stage_4_1/conv1" 3396 | top: "stage_4_1/conv1" 3397 | param { 3398 | lr_mult: 0.0 3399 | decay_mult: 0.0 3400 | } 3401 | param { 3402 | lr_mult: 0.0 3403 | decay_mult: 0.0 3404 | } 3405 | param { 3406 | lr_mult: 0.0 3407 | decay_mult: 0.0 3408 | } 3409 | } 3410 | layer { 3411 | name: "stage_4_1/conv1/bn/scale" 3412 | type: "Scale" 3413 | bottom: "stage_4_1/conv1" 3414 | top: "stage_4_1/conv1" 3415 | param { 3416 | lr_mult: 1.0 3417 | decay_mult: 0.0 3418 | } 3419 | param { 3420 | lr_mult: 1.0 3421 | decay_mult: 0.0 3422 | } 3423 | scale_param { 3424 | filler { 3425 | type: "constant" 3426 | value: 1.0 3427 | } 3428 | bias_term: true 3429 | bias_filler { 3430 | type: "constant" 3431 | value: 0.0 3432 | } 3433 | } 3434 | } 3435 | layer { 3436 | name: "stage_4_1/conv1/relu" 3437 | type: "ReLU" 3438 | bottom: "stage_4_1/conv1" 3439 | top: "stage_4_1/conv1" 3440 | } 3441 | layer { 3442 | name: "stage_4_1/conv2" 3443 | type: "Convolution" 3444 | bottom: "stage_4_1/conv1" 3445 | top: "stage_4_1/conv2" 3446 | param { 3447 | lr_mult: 1.0 3448 | decay_mult: 1.0 3449 | } 3450 | convolution_param { 3451 | num_output: 96 3452 | bias_term: false 3453 | pad: 1 3454 | kernel_size: 3 3455 | group: 96 3456 | stride: 2 3457 | weight_filler { 3458 | type: "msra" 3459 | } 3460 | dilation: 1 3461 | } 3462 | } 3463 | layer { 3464 | name: "stage_4_1/conv2/bn" 3465 | type: "BatchNorm" 3466 | bottom: "stage_4_1/conv2" 3467 | top: "stage_4_1/conv2" 3468 | param { 3469 | lr_mult: 0.0 3470 | decay_mult: 0.0 3471 | } 3472 | param { 3473 | lr_mult: 0.0 3474 | decay_mult: 0.0 3475 | } 3476 | param { 3477 | lr_mult: 0.0 3478 | decay_mult: 0.0 3479 | } 3480 | } 3481 | layer { 3482 | name: "stage_4_1/conv2/bn/scale" 3483 | type: "Scale" 3484 | bottom: "stage_4_1/conv2" 3485 | top: "stage_4_1/conv2" 3486 | param { 3487 | lr_mult: 1.0 3488 | decay_mult: 0.0 3489 | } 3490 | param { 3491 | lr_mult: 1.0 3492 | decay_mult: 0.0 3493 | } 3494 | scale_param { 3495 | filler { 3496 | type: "constant" 3497 | value: 1.0 3498 | } 3499 | bias_term: true 3500 | bias_filler { 3501 | type: "constant" 3502 | value: 0.0 3503 | } 3504 | } 3505 | } 3506 | layer { 3507 | name: "stage_4_1/conv3" 3508 | type: "Convolution" 3509 | bottom: "stage_4_1/conv2" 3510 | top: "stage_4_1/conv3" 3511 | param { 3512 | lr_mult: 1.0 3513 | decay_mult: 1.0 3514 | } 3515 | convolution_param { 3516 | num_output: 96 3517 | bias_term: false 3518 | pad: 0 3519 | kernel_size: 1 3520 | group: 1 3521 | stride: 1 3522 | weight_filler { 3523 | type: "msra" 3524 | } 3525 | dilation: 1 3526 | } 3527 | } 3528 | layer { 3529 | name: "stage_4_1/conv3/bn" 3530 | type: "BatchNorm" 3531 | bottom: "stage_4_1/conv3" 3532 | top: "stage_4_1/conv3" 3533 | param { 3534 | lr_mult: 0.0 3535 | decay_mult: 0.0 3536 | } 3537 | param { 3538 | lr_mult: 0.0 3539 | decay_mult: 0.0 3540 | } 3541 | param { 3542 | lr_mult: 0.0 3543 | decay_mult: 0.0 3544 | } 3545 | } 3546 | layer { 3547 | name: "stage_4_1/conv3/bn/scale" 3548 | type: "Scale" 3549 | bottom: "stage_4_1/conv3" 3550 | top: "stage_4_1/conv3" 3551 | param { 3552 | lr_mult: 1.0 3553 | decay_mult: 0.0 3554 | } 3555 | param { 3556 | lr_mult: 1.0 3557 | decay_mult: 0.0 3558 | } 3559 | scale_param { 3560 | filler { 3561 | type: "constant" 3562 | value: 1.0 3563 | } 3564 | bias_term: true 3565 | bias_filler { 3566 | type: "constant" 3567 | value: 0.0 3568 | } 3569 | } 3570 | } 3571 | layer { 3572 | name: "stage_4_1/conv3/relu" 3573 | type: "ReLU" 3574 | bottom: "stage_4_1/conv3" 3575 | top: "stage_4_1/conv3" 3576 | } 3577 | layer { 3578 | name: "stage_4_1/concat" 3579 | type: "Concat" 3580 | bottom: "stage_4_1/conv5" 3581 | bottom: "stage_4_1/conv3" 3582 | top: "stage_4_1/concat" 3583 | concat_param { 3584 | axis: 1 3585 | } 3586 | } 3587 | layer { 3588 | name: "stage_4_1/shuffle" 3589 | type: "ShuffleChannel" 3590 | bottom: "stage_4_1/concat" 3591 | top: "stage_4_1/shuffle" 3592 | shuffle_channel_param { 3593 | group: 2 3594 | } 3595 | } 3596 | layer { 3597 | name: "stage_4_2/slice1" 3598 | type: "Slice" 3599 | bottom: "stage_4_1/shuffle" 3600 | top: "stage_4_2/slice1" 3601 | top: "stage_4_2/slice2" 3602 | slice_param { 3603 | slice_point: 96 3604 | axis: 1 3605 | } 3606 | } 3607 | layer { 3608 | name: "stage_4_2/conv1" 3609 | type: "Convolution" 3610 | bottom: "stage_4_2/slice2" 3611 | top: "stage_4_2/conv1" 3612 | param { 3613 | lr_mult: 1.0 3614 | decay_mult: 1.0 3615 | } 3616 | convolution_param { 3617 | num_output: 96 3618 | bias_term: false 3619 | pad: 0 3620 | kernel_size: 1 3621 | group: 1 3622 | stride: 1 3623 | weight_filler { 3624 | type: "msra" 3625 | } 3626 | dilation: 1 3627 | } 3628 | } 3629 | layer { 3630 | name: "stage_4_2/conv1/bn" 3631 | type: "BatchNorm" 3632 | bottom: "stage_4_2/conv1" 3633 | top: "stage_4_2/conv1" 3634 | param { 3635 | lr_mult: 0.0 3636 | decay_mult: 0.0 3637 | } 3638 | param { 3639 | lr_mult: 0.0 3640 | decay_mult: 0.0 3641 | } 3642 | param { 3643 | lr_mult: 0.0 3644 | decay_mult: 0.0 3645 | } 3646 | } 3647 | layer { 3648 | name: "stage_4_2/conv1/bn/scale" 3649 | type: "Scale" 3650 | bottom: "stage_4_2/conv1" 3651 | top: "stage_4_2/conv1" 3652 | param { 3653 | lr_mult: 1.0 3654 | decay_mult: 0.0 3655 | } 3656 | param { 3657 | lr_mult: 1.0 3658 | decay_mult: 0.0 3659 | } 3660 | scale_param { 3661 | filler { 3662 | type: "constant" 3663 | value: 1.0 3664 | } 3665 | bias_term: true 3666 | bias_filler { 3667 | type: "constant" 3668 | value: 0.0 3669 | } 3670 | } 3671 | } 3672 | layer { 3673 | name: "stage_4_2/conv1/relu" 3674 | type: "ReLU" 3675 | bottom: "stage_4_2/conv1" 3676 | top: "stage_4_2/conv1" 3677 | } 3678 | layer { 3679 | name: "stage_4_2/conv2" 3680 | type: "Convolution" 3681 | bottom: "stage_4_2/conv1" 3682 | top: "stage_4_2/conv2" 3683 | param { 3684 | lr_mult: 1.0 3685 | decay_mult: 1.0 3686 | } 3687 | convolution_param { 3688 | num_output: 96 3689 | bias_term: false 3690 | pad: 1 3691 | kernel_size: 3 3692 | group: 96 3693 | stride: 1 3694 | weight_filler { 3695 | type: "msra" 3696 | } 3697 | dilation: 1 3698 | } 3699 | } 3700 | layer { 3701 | name: "stage_4_2/conv2/bn" 3702 | type: "BatchNorm" 3703 | bottom: "stage_4_2/conv2" 3704 | top: "stage_4_2/conv2" 3705 | param { 3706 | lr_mult: 0.0 3707 | decay_mult: 0.0 3708 | } 3709 | param { 3710 | lr_mult: 0.0 3711 | decay_mult: 0.0 3712 | } 3713 | param { 3714 | lr_mult: 0.0 3715 | decay_mult: 0.0 3716 | } 3717 | } 3718 | layer { 3719 | name: "stage_4_2/conv2/bn/scale" 3720 | type: "Scale" 3721 | bottom: "stage_4_2/conv2" 3722 | top: "stage_4_2/conv2" 3723 | param { 3724 | lr_mult: 1.0 3725 | decay_mult: 0.0 3726 | } 3727 | param { 3728 | lr_mult: 1.0 3729 | decay_mult: 0.0 3730 | } 3731 | scale_param { 3732 | filler { 3733 | type: "constant" 3734 | value: 1.0 3735 | } 3736 | bias_term: true 3737 | bias_filler { 3738 | type: "constant" 3739 | value: 0.0 3740 | } 3741 | } 3742 | } 3743 | layer { 3744 | name: "stage_4_2/conv3" 3745 | type: "Convolution" 3746 | bottom: "stage_4_2/conv2" 3747 | top: "stage_4_2/conv3" 3748 | param { 3749 | lr_mult: 1.0 3750 | decay_mult: 1.0 3751 | } 3752 | convolution_param { 3753 | num_output: 96 3754 | bias_term: false 3755 | pad: 0 3756 | kernel_size: 1 3757 | group: 1 3758 | stride: 1 3759 | weight_filler { 3760 | type: "msra" 3761 | } 3762 | dilation: 1 3763 | } 3764 | } 3765 | layer { 3766 | name: "stage_4_2/conv3/bn" 3767 | type: "BatchNorm" 3768 | bottom: "stage_4_2/conv3" 3769 | top: "stage_4_2/conv3" 3770 | param { 3771 | lr_mult: 0.0 3772 | decay_mult: 0.0 3773 | } 3774 | param { 3775 | lr_mult: 0.0 3776 | decay_mult: 0.0 3777 | } 3778 | param { 3779 | lr_mult: 0.0 3780 | decay_mult: 0.0 3781 | } 3782 | } 3783 | layer { 3784 | name: "stage_4_2/conv3/bn/scale" 3785 | type: "Scale" 3786 | bottom: "stage_4_2/conv3" 3787 | top: "stage_4_2/conv3" 3788 | param { 3789 | lr_mult: 1.0 3790 | decay_mult: 0.0 3791 | } 3792 | param { 3793 | lr_mult: 1.0 3794 | decay_mult: 0.0 3795 | } 3796 | scale_param { 3797 | filler { 3798 | type: "constant" 3799 | value: 1.0 3800 | } 3801 | bias_term: true 3802 | bias_filler { 3803 | type: "constant" 3804 | value: 0.0 3805 | } 3806 | } 3807 | } 3808 | layer { 3809 | name: "stage_4_2/conv3/relu" 3810 | type: "ReLU" 3811 | bottom: "stage_4_2/conv3" 3812 | top: "stage_4_2/conv3" 3813 | } 3814 | layer { 3815 | name: "stage_4_2/concat" 3816 | type: "Concat" 3817 | bottom: "stage_4_2/slice1" 3818 | bottom: "stage_4_2/conv3" 3819 | top: "stage_4_2/concat" 3820 | concat_param { 3821 | axis: 1 3822 | } 3823 | } 3824 | layer { 3825 | name: "stage_4_2/shuffle" 3826 | type: "ShuffleChannel" 3827 | bottom: "stage_4_2/concat" 3828 | top: "stage_4_2/shuffle" 3829 | shuffle_channel_param { 3830 | group: 2 3831 | } 3832 | } 3833 | layer { 3834 | name: "stage_4_3/slice1" 3835 | type: "Slice" 3836 | bottom: "stage_4_2/shuffle" 3837 | top: "stage_4_3/slice1" 3838 | top: "stage_4_3/slice2" 3839 | slice_param { 3840 | slice_point: 96 3841 | axis: 1 3842 | } 3843 | } 3844 | layer { 3845 | name: "stage_4_3/conv1" 3846 | type: "Convolution" 3847 | bottom: "stage_4_3/slice2" 3848 | top: "stage_4_3/conv1" 3849 | param { 3850 | lr_mult: 1.0 3851 | decay_mult: 1.0 3852 | } 3853 | convolution_param { 3854 | num_output: 96 3855 | bias_term: false 3856 | pad: 0 3857 | kernel_size: 1 3858 | group: 1 3859 | stride: 1 3860 | weight_filler { 3861 | type: "msra" 3862 | } 3863 | dilation: 1 3864 | } 3865 | } 3866 | layer { 3867 | name: "stage_4_3/conv1/bn" 3868 | type: "BatchNorm" 3869 | bottom: "stage_4_3/conv1" 3870 | top: "stage_4_3/conv1" 3871 | param { 3872 | lr_mult: 0.0 3873 | decay_mult: 0.0 3874 | } 3875 | param { 3876 | lr_mult: 0.0 3877 | decay_mult: 0.0 3878 | } 3879 | param { 3880 | lr_mult: 0.0 3881 | decay_mult: 0.0 3882 | } 3883 | } 3884 | layer { 3885 | name: "stage_4_3/conv1/bn/scale" 3886 | type: "Scale" 3887 | bottom: "stage_4_3/conv1" 3888 | top: "stage_4_3/conv1" 3889 | param { 3890 | lr_mult: 1.0 3891 | decay_mult: 0.0 3892 | } 3893 | param { 3894 | lr_mult: 1.0 3895 | decay_mult: 0.0 3896 | } 3897 | scale_param { 3898 | filler { 3899 | type: "constant" 3900 | value: 1.0 3901 | } 3902 | bias_term: true 3903 | bias_filler { 3904 | type: "constant" 3905 | value: 0.0 3906 | } 3907 | } 3908 | } 3909 | layer { 3910 | name: "stage_4_3/conv1/relu" 3911 | type: "ReLU" 3912 | bottom: "stage_4_3/conv1" 3913 | top: "stage_4_3/conv1" 3914 | } 3915 | layer { 3916 | name: "stage_4_3/conv2" 3917 | type: "Convolution" 3918 | bottom: "stage_4_3/conv1" 3919 | top: "stage_4_3/conv2" 3920 | param { 3921 | lr_mult: 1.0 3922 | decay_mult: 1.0 3923 | } 3924 | convolution_param { 3925 | num_output: 96 3926 | bias_term: false 3927 | pad: 1 3928 | kernel_size: 3 3929 | group: 96 3930 | stride: 1 3931 | weight_filler { 3932 | type: "msra" 3933 | } 3934 | dilation: 1 3935 | } 3936 | } 3937 | layer { 3938 | name: "stage_4_3/conv2/bn" 3939 | type: "BatchNorm" 3940 | bottom: "stage_4_3/conv2" 3941 | top: "stage_4_3/conv2" 3942 | param { 3943 | lr_mult: 0.0 3944 | decay_mult: 0.0 3945 | } 3946 | param { 3947 | lr_mult: 0.0 3948 | decay_mult: 0.0 3949 | } 3950 | param { 3951 | lr_mult: 0.0 3952 | decay_mult: 0.0 3953 | } 3954 | } 3955 | layer { 3956 | name: "stage_4_3/conv2/bn/scale" 3957 | type: "Scale" 3958 | bottom: "stage_4_3/conv2" 3959 | top: "stage_4_3/conv2" 3960 | param { 3961 | lr_mult: 1.0 3962 | decay_mult: 0.0 3963 | } 3964 | param { 3965 | lr_mult: 1.0 3966 | decay_mult: 0.0 3967 | } 3968 | scale_param { 3969 | filler { 3970 | type: "constant" 3971 | value: 1.0 3972 | } 3973 | bias_term: true 3974 | bias_filler { 3975 | type: "constant" 3976 | value: 0.0 3977 | } 3978 | } 3979 | } 3980 | layer { 3981 | name: "stage_4_3/conv3" 3982 | type: "Convolution" 3983 | bottom: "stage_4_3/conv2" 3984 | top: "stage_4_3/conv3" 3985 | param { 3986 | lr_mult: 1.0 3987 | decay_mult: 1.0 3988 | } 3989 | convolution_param { 3990 | num_output: 96 3991 | bias_term: false 3992 | pad: 0 3993 | kernel_size: 1 3994 | group: 1 3995 | stride: 1 3996 | weight_filler { 3997 | type: "msra" 3998 | } 3999 | dilation: 1 4000 | } 4001 | } 4002 | layer { 4003 | name: "stage_4_3/conv3/bn" 4004 | type: "BatchNorm" 4005 | bottom: "stage_4_3/conv3" 4006 | top: "stage_4_3/conv3" 4007 | param { 4008 | lr_mult: 0.0 4009 | decay_mult: 0.0 4010 | } 4011 | param { 4012 | lr_mult: 0.0 4013 | decay_mult: 0.0 4014 | } 4015 | param { 4016 | lr_mult: 0.0 4017 | decay_mult: 0.0 4018 | } 4019 | } 4020 | layer { 4021 | name: "stage_4_3/conv3/bn/scale" 4022 | type: "Scale" 4023 | bottom: "stage_4_3/conv3" 4024 | top: "stage_4_3/conv3" 4025 | param { 4026 | lr_mult: 1.0 4027 | decay_mult: 0.0 4028 | } 4029 | param { 4030 | lr_mult: 1.0 4031 | decay_mult: 0.0 4032 | } 4033 | scale_param { 4034 | filler { 4035 | type: "constant" 4036 | value: 1.0 4037 | } 4038 | bias_term: true 4039 | bias_filler { 4040 | type: "constant" 4041 | value: 0.0 4042 | } 4043 | } 4044 | } 4045 | layer { 4046 | name: "stage_4_3/conv3/relu" 4047 | type: "ReLU" 4048 | bottom: "stage_4_3/conv3" 4049 | top: "stage_4_3/conv3" 4050 | } 4051 | layer { 4052 | name: "stage_4_3/concat" 4053 | type: "Concat" 4054 | bottom: "stage_4_3/slice1" 4055 | bottom: "stage_4_3/conv3" 4056 | top: "stage_4_3/concat" 4057 | concat_param { 4058 | axis: 1 4059 | } 4060 | } 4061 | layer { 4062 | name: "stage_4_3/shuffle" 4063 | type: "ShuffleChannel" 4064 | bottom: "stage_4_3/concat" 4065 | top: "stage_4_3/shuffle" 4066 | shuffle_channel_param { 4067 | group: 2 4068 | } 4069 | } 4070 | layer { 4071 | name: "stage_4_4/slice1" 4072 | type: "Slice" 4073 | bottom: "stage_4_3/shuffle" 4074 | top: "stage_4_4/slice1" 4075 | top: "stage_4_4/slice2" 4076 | slice_param { 4077 | slice_point: 96 4078 | axis: 1 4079 | } 4080 | } 4081 | layer { 4082 | name: "stage_4_4/conv1" 4083 | type: "Convolution" 4084 | bottom: "stage_4_4/slice2" 4085 | top: "stage_4_4/conv1" 4086 | param { 4087 | lr_mult: 1.0 4088 | decay_mult: 1.0 4089 | } 4090 | convolution_param { 4091 | num_output: 96 4092 | bias_term: false 4093 | pad: 0 4094 | kernel_size: 1 4095 | group: 1 4096 | stride: 1 4097 | weight_filler { 4098 | type: "msra" 4099 | } 4100 | dilation: 1 4101 | } 4102 | } 4103 | layer { 4104 | name: "stage_4_4/conv1/bn" 4105 | type: "BatchNorm" 4106 | bottom: "stage_4_4/conv1" 4107 | top: "stage_4_4/conv1" 4108 | param { 4109 | lr_mult: 0.0 4110 | decay_mult: 0.0 4111 | } 4112 | param { 4113 | lr_mult: 0.0 4114 | decay_mult: 0.0 4115 | } 4116 | param { 4117 | lr_mult: 0.0 4118 | decay_mult: 0.0 4119 | } 4120 | } 4121 | layer { 4122 | name: "stage_4_4/conv1/bn/scale" 4123 | type: "Scale" 4124 | bottom: "stage_4_4/conv1" 4125 | top: "stage_4_4/conv1" 4126 | param { 4127 | lr_mult: 1.0 4128 | decay_mult: 0.0 4129 | } 4130 | param { 4131 | lr_mult: 1.0 4132 | decay_mult: 0.0 4133 | } 4134 | scale_param { 4135 | filler { 4136 | type: "constant" 4137 | value: 1.0 4138 | } 4139 | bias_term: true 4140 | bias_filler { 4141 | type: "constant" 4142 | value: 0.0 4143 | } 4144 | } 4145 | } 4146 | layer { 4147 | name: "stage_4_4/conv1/relu" 4148 | type: "ReLU" 4149 | bottom: "stage_4_4/conv1" 4150 | top: "stage_4_4/conv1" 4151 | } 4152 | layer { 4153 | name: "stage_4_4/conv2" 4154 | type: "Convolution" 4155 | bottom: "stage_4_4/conv1" 4156 | top: "stage_4_4/conv2" 4157 | param { 4158 | lr_mult: 1.0 4159 | decay_mult: 1.0 4160 | } 4161 | convolution_param { 4162 | num_output: 96 4163 | bias_term: false 4164 | pad: 1 4165 | kernel_size: 3 4166 | group: 96 4167 | stride: 1 4168 | weight_filler { 4169 | type: "msra" 4170 | } 4171 | dilation: 1 4172 | } 4173 | } 4174 | layer { 4175 | name: "stage_4_4/conv2/bn" 4176 | type: "BatchNorm" 4177 | bottom: "stage_4_4/conv2" 4178 | top: "stage_4_4/conv2" 4179 | param { 4180 | lr_mult: 0.0 4181 | decay_mult: 0.0 4182 | } 4183 | param { 4184 | lr_mult: 0.0 4185 | decay_mult: 0.0 4186 | } 4187 | param { 4188 | lr_mult: 0.0 4189 | decay_mult: 0.0 4190 | } 4191 | } 4192 | layer { 4193 | name: "stage_4_4/conv2/bn/scale" 4194 | type: "Scale" 4195 | bottom: "stage_4_4/conv2" 4196 | top: "stage_4_4/conv2" 4197 | param { 4198 | lr_mult: 1.0 4199 | decay_mult: 0.0 4200 | } 4201 | param { 4202 | lr_mult: 1.0 4203 | decay_mult: 0.0 4204 | } 4205 | scale_param { 4206 | filler { 4207 | type: "constant" 4208 | value: 1.0 4209 | } 4210 | bias_term: true 4211 | bias_filler { 4212 | type: "constant" 4213 | value: 0.0 4214 | } 4215 | } 4216 | } 4217 | layer { 4218 | name: "stage_4_4/conv3" 4219 | type: "Convolution" 4220 | bottom: "stage_4_4/conv2" 4221 | top: "stage_4_4/conv3" 4222 | param { 4223 | lr_mult: 1.0 4224 | decay_mult: 1.0 4225 | } 4226 | convolution_param { 4227 | num_output: 96 4228 | bias_term: false 4229 | pad: 0 4230 | kernel_size: 1 4231 | group: 1 4232 | stride: 1 4233 | weight_filler { 4234 | type: "msra" 4235 | } 4236 | dilation: 1 4237 | } 4238 | } 4239 | layer { 4240 | name: "stage_4_4/conv3/bn" 4241 | type: "BatchNorm" 4242 | bottom: "stage_4_4/conv3" 4243 | top: "stage_4_4/conv3" 4244 | param { 4245 | lr_mult: 0.0 4246 | decay_mult: 0.0 4247 | } 4248 | param { 4249 | lr_mult: 0.0 4250 | decay_mult: 0.0 4251 | } 4252 | param { 4253 | lr_mult: 0.0 4254 | decay_mult: 0.0 4255 | } 4256 | } 4257 | layer { 4258 | name: "stage_4_4/conv3/bn/scale" 4259 | type: "Scale" 4260 | bottom: "stage_4_4/conv3" 4261 | top: "stage_4_4/conv3" 4262 | param { 4263 | lr_mult: 1.0 4264 | decay_mult: 0.0 4265 | } 4266 | param { 4267 | lr_mult: 1.0 4268 | decay_mult: 0.0 4269 | } 4270 | scale_param { 4271 | filler { 4272 | type: "constant" 4273 | value: 1.0 4274 | } 4275 | bias_term: true 4276 | bias_filler { 4277 | type: "constant" 4278 | value: 0.0 4279 | } 4280 | } 4281 | } 4282 | layer { 4283 | name: "stage_4_4/conv3/relu" 4284 | type: "ReLU" 4285 | bottom: "stage_4_4/conv3" 4286 | top: "stage_4_4/conv3" 4287 | } 4288 | layer { 4289 | name: "stage_4_4/concat" 4290 | type: "Concat" 4291 | bottom: "stage_4_4/slice1" 4292 | bottom: "stage_4_4/conv3" 4293 | top: "stage_4_4/concat" 4294 | concat_param { 4295 | axis: 1 4296 | } 4297 | } 4298 | layer { 4299 | name: "stage_4_4/shuffle" 4300 | type: "ShuffleChannel" 4301 | bottom: "stage_4_4/concat" 4302 | top: "stage_4_4/shuffle" 4303 | shuffle_channel_param { 4304 | group: 2 4305 | } 4306 | } 4307 | layer { 4308 | name: "conv5" 4309 | type: "Convolution" 4310 | bottom: "stage_4_4/shuffle" 4311 | top: "conv5" 4312 | param { 4313 | lr_mult: 1.0 4314 | decay_mult: 1.0 4315 | } 4316 | convolution_param { 4317 | num_output: 1024 4318 | bias_term: false 4319 | pad: 0 4320 | kernel_size: 1 4321 | group: 1 4322 | stride: 1 4323 | weight_filler { 4324 | type: "msra" 4325 | } 4326 | dilation: 1 4327 | } 4328 | } 4329 | layer { 4330 | name: "conv5/bn" 4331 | type: "BatchNorm" 4332 | bottom: "conv5" 4333 | top: "conv5" 4334 | param { 4335 | lr_mult: 0.0 4336 | decay_mult: 0.0 4337 | } 4338 | param { 4339 | lr_mult: 0.0 4340 | decay_mult: 0.0 4341 | } 4342 | param { 4343 | lr_mult: 0.0 4344 | decay_mult: 0.0 4345 | } 4346 | } 4347 | layer { 4348 | name: "conv5/bn/scale" 4349 | type: "Scale" 4350 | bottom: "conv5" 4351 | top: "conv5" 4352 | param { 4353 | lr_mult: 1.0 4354 | decay_mult: 0.0 4355 | } 4356 | param { 4357 | lr_mult: 1.0 4358 | decay_mult: 0.0 4359 | } 4360 | scale_param { 4361 | filler { 4362 | type: "constant" 4363 | value: 1.0 4364 | } 4365 | bias_term: true 4366 | bias_filler { 4367 | type: "constant" 4368 | value: 0.0 4369 | } 4370 | } 4371 | } 4372 | layer { 4373 | name: "conv5/relu" 4374 | type: "ReLU" 4375 | bottom: "conv5" 4376 | top: "conv5" 4377 | } 4378 | layer { 4379 | name: "pool" 4380 | type: "Pooling" 4381 | bottom: "conv5" 4382 | top: "pool" 4383 | pooling_param { 4384 | pool: AVE 4385 | kernel_size: 7 4386 | stride: 1 4387 | pad: 0 4388 | } 4389 | } 4390 | layer { 4391 | name: "fc" 4392 | type: "Convolution" 4393 | bottom: "pool" 4394 | top: "fc" 4395 | param { 4396 | lr_mult: 1.0 4397 | decay_mult: 1.0 4398 | } 4399 | param { 4400 | lr_mult: 1.0 4401 | decay_mult: 0.0 4402 | } 4403 | convolution_param { 4404 | num_output: 1000 4405 | bias_term: true 4406 | pad: 0 4407 | kernel_size: 1 4408 | group: 1 4409 | stride: 1 4410 | weight_filler { 4411 | type: "msra" 4412 | } 4413 | dilation: 1 4414 | } 4415 | } 4416 | -------------------------------------------------------------------------------- /shufflenet_v2_x1.0.prototxt: -------------------------------------------------------------------------------- 1 | layer { 2 | name: "data" 3 | type: "Input" 4 | top: "data" 5 | input_param { 6 | shape { 7 | dim: 1 8 | dim: 3 9 | dim: 224 10 | dim: 224 11 | } 12 | } 13 | } 14 | layer { 15 | name: "data/bn" 16 | type: "BatchNorm" 17 | bottom: "data" 18 | top: "data" 19 | param { 20 | lr_mult: 0.0 21 | decay_mult: 0.0 22 | } 23 | param { 24 | lr_mult: 0.0 25 | decay_mult: 0.0 26 | } 27 | param { 28 | lr_mult: 0.0 29 | decay_mult: 0.0 30 | } 31 | } 32 | layer { 33 | name: "data/bn/scale" 34 | type: "Scale" 35 | bottom: "data" 36 | top: "data" 37 | param { 38 | lr_mult: 1.0 39 | decay_mult: 0.0 40 | } 41 | param { 42 | lr_mult: 1.0 43 | decay_mult: 0.0 44 | } 45 | scale_param { 46 | filler { 47 | type: "constant" 48 | value: 1.0 49 | } 50 | bias_term: true 51 | bias_filler { 52 | type: "constant" 53 | value: 0.0 54 | } 55 | } 56 | } 57 | layer { 58 | name: "stage1/conv" 59 | type: "Convolution" 60 | bottom: "data" 61 | top: "stage1/conv" 62 | param { 63 | lr_mult: 1.0 64 | decay_mult: 1.0 65 | } 66 | convolution_param { 67 | num_output: 24 68 | bias_term: false 69 | pad: 1 70 | kernel_size: 3 71 | group: 1 72 | stride: 2 73 | weight_filler { 74 | type: "msra" 75 | } 76 | dilation: 1 77 | } 78 | } 79 | layer { 80 | name: "stage1/conv/bn" 81 | type: "BatchNorm" 82 | bottom: "stage1/conv" 83 | top: "stage1/conv" 84 | param { 85 | lr_mult: 0.0 86 | decay_mult: 0.0 87 | } 88 | param { 89 | lr_mult: 0.0 90 | decay_mult: 0.0 91 | } 92 | param { 93 | lr_mult: 0.0 94 | decay_mult: 0.0 95 | } 96 | } 97 | layer { 98 | name: "stage1/conv/bn/scale" 99 | type: "Scale" 100 | bottom: "stage1/conv" 101 | top: "stage1/conv" 102 | param { 103 | lr_mult: 1.0 104 | decay_mult: 0.0 105 | } 106 | param { 107 | lr_mult: 1.0 108 | decay_mult: 0.0 109 | } 110 | scale_param { 111 | filler { 112 | type: "constant" 113 | value: 1.0 114 | } 115 | bias_term: true 116 | bias_filler { 117 | type: "constant" 118 | value: 0.0 119 | } 120 | } 121 | } 122 | layer { 123 | name: "stage1/conv/relu" 124 | type: "ReLU" 125 | bottom: "stage1/conv" 126 | top: "stage1/conv" 127 | } 128 | layer { 129 | name: "stage1/pool" 130 | type: "Pooling" 131 | bottom: "stage1/conv" 132 | top: "stage1/pool" 133 | pooling_param { 134 | pool: MAX 135 | kernel_size: 3 136 | stride: 2 137 | pad: 0 138 | } 139 | } 140 | layer { 141 | name: "stage_2_1/conv4" 142 | type: "Convolution" 143 | bottom: "stage1/pool" 144 | top: "stage_2_1/conv4" 145 | param { 146 | lr_mult: 1.0 147 | decay_mult: 1.0 148 | } 149 | convolution_param { 150 | num_output: 24 151 | bias_term: false 152 | pad: 1 153 | kernel_size: 3 154 | group: 24 155 | stride: 2 156 | weight_filler { 157 | type: "msra" 158 | } 159 | dilation: 1 160 | } 161 | } 162 | layer { 163 | name: "stage_2_1/conv4/bn" 164 | type: "BatchNorm" 165 | bottom: "stage_2_1/conv4" 166 | top: "stage_2_1/conv4" 167 | param { 168 | lr_mult: 0.0 169 | decay_mult: 0.0 170 | } 171 | param { 172 | lr_mult: 0.0 173 | decay_mult: 0.0 174 | } 175 | param { 176 | lr_mult: 0.0 177 | decay_mult: 0.0 178 | } 179 | } 180 | layer { 181 | name: "stage_2_1/conv4/bn/scale" 182 | type: "Scale" 183 | bottom: "stage_2_1/conv4" 184 | top: "stage_2_1/conv4" 185 | param { 186 | lr_mult: 1.0 187 | decay_mult: 0.0 188 | } 189 | param { 190 | lr_mult: 1.0 191 | decay_mult: 0.0 192 | } 193 | scale_param { 194 | filler { 195 | type: "constant" 196 | value: 1.0 197 | } 198 | bias_term: true 199 | bias_filler { 200 | type: "constant" 201 | value: 0.0 202 | } 203 | } 204 | } 205 | layer { 206 | name: "stage_2_1/conv5" 207 | type: "Convolution" 208 | bottom: "stage_2_1/conv4" 209 | top: "stage_2_1/conv5" 210 | param { 211 | lr_mult: 1.0 212 | decay_mult: 1.0 213 | } 214 | convolution_param { 215 | num_output: 58 216 | bias_term: false 217 | pad: 0 218 | kernel_size: 1 219 | group: 1 220 | stride: 1 221 | weight_filler { 222 | type: "msra" 223 | } 224 | dilation: 1 225 | } 226 | } 227 | layer { 228 | name: "stage_2_1/conv5/bn" 229 | type: "BatchNorm" 230 | bottom: "stage_2_1/conv5" 231 | top: "stage_2_1/conv5" 232 | param { 233 | lr_mult: 0.0 234 | decay_mult: 0.0 235 | } 236 | param { 237 | lr_mult: 0.0 238 | decay_mult: 0.0 239 | } 240 | param { 241 | lr_mult: 0.0 242 | decay_mult: 0.0 243 | } 244 | } 245 | layer { 246 | name: "stage_2_1/conv5/bn/scale" 247 | type: "Scale" 248 | bottom: "stage_2_1/conv5" 249 | top: "stage_2_1/conv5" 250 | param { 251 | lr_mult: 1.0 252 | decay_mult: 0.0 253 | } 254 | param { 255 | lr_mult: 1.0 256 | decay_mult: 0.0 257 | } 258 | scale_param { 259 | filler { 260 | type: "constant" 261 | value: 1.0 262 | } 263 | bias_term: true 264 | bias_filler { 265 | type: "constant" 266 | value: 0.0 267 | } 268 | } 269 | } 270 | layer { 271 | name: "stage_2_1/conv5/relu" 272 | type: "ReLU" 273 | bottom: "stage_2_1/conv5" 274 | top: "stage_2_1/conv5" 275 | } 276 | layer { 277 | name: "stage_2_1/conv1" 278 | type: "Convolution" 279 | bottom: "stage1/pool" 280 | top: "stage_2_1/conv1" 281 | param { 282 | lr_mult: 1.0 283 | decay_mult: 1.0 284 | } 285 | convolution_param { 286 | num_output: 58 287 | bias_term: false 288 | pad: 0 289 | kernel_size: 1 290 | group: 1 291 | stride: 1 292 | weight_filler { 293 | type: "msra" 294 | } 295 | dilation: 1 296 | } 297 | } 298 | layer { 299 | name: "stage_2_1/conv1/bn" 300 | type: "BatchNorm" 301 | bottom: "stage_2_1/conv1" 302 | top: "stage_2_1/conv1" 303 | param { 304 | lr_mult: 0.0 305 | decay_mult: 0.0 306 | } 307 | param { 308 | lr_mult: 0.0 309 | decay_mult: 0.0 310 | } 311 | param { 312 | lr_mult: 0.0 313 | decay_mult: 0.0 314 | } 315 | } 316 | layer { 317 | name: "stage_2_1/conv1/bn/scale" 318 | type: "Scale" 319 | bottom: "stage_2_1/conv1" 320 | top: "stage_2_1/conv1" 321 | param { 322 | lr_mult: 1.0 323 | decay_mult: 0.0 324 | } 325 | param { 326 | lr_mult: 1.0 327 | decay_mult: 0.0 328 | } 329 | scale_param { 330 | filler { 331 | type: "constant" 332 | value: 1.0 333 | } 334 | bias_term: true 335 | bias_filler { 336 | type: "constant" 337 | value: 0.0 338 | } 339 | } 340 | } 341 | layer { 342 | name: "stage_2_1/conv1/relu" 343 | type: "ReLU" 344 | bottom: "stage_2_1/conv1" 345 | top: "stage_2_1/conv1" 346 | } 347 | layer { 348 | name: "stage_2_1/conv2" 349 | type: "Convolution" 350 | bottom: "stage_2_1/conv1" 351 | top: "stage_2_1/conv2" 352 | param { 353 | lr_mult: 1.0 354 | decay_mult: 1.0 355 | } 356 | convolution_param { 357 | num_output: 58 358 | bias_term: false 359 | pad: 1 360 | kernel_size: 3 361 | group: 58 362 | stride: 2 363 | weight_filler { 364 | type: "msra" 365 | } 366 | dilation: 1 367 | } 368 | } 369 | layer { 370 | name: "stage_2_1/conv2/bn" 371 | type: "BatchNorm" 372 | bottom: "stage_2_1/conv2" 373 | top: "stage_2_1/conv2" 374 | param { 375 | lr_mult: 0.0 376 | decay_mult: 0.0 377 | } 378 | param { 379 | lr_mult: 0.0 380 | decay_mult: 0.0 381 | } 382 | param { 383 | lr_mult: 0.0 384 | decay_mult: 0.0 385 | } 386 | } 387 | layer { 388 | name: "stage_2_1/conv2/bn/scale" 389 | type: "Scale" 390 | bottom: "stage_2_1/conv2" 391 | top: "stage_2_1/conv2" 392 | param { 393 | lr_mult: 1.0 394 | decay_mult: 0.0 395 | } 396 | param { 397 | lr_mult: 1.0 398 | decay_mult: 0.0 399 | } 400 | scale_param { 401 | filler { 402 | type: "constant" 403 | value: 1.0 404 | } 405 | bias_term: true 406 | bias_filler { 407 | type: "constant" 408 | value: 0.0 409 | } 410 | } 411 | } 412 | layer { 413 | name: "stage_2_1/conv3" 414 | type: "Convolution" 415 | bottom: "stage_2_1/conv2" 416 | top: "stage_2_1/conv3" 417 | param { 418 | lr_mult: 1.0 419 | decay_mult: 1.0 420 | } 421 | convolution_param { 422 | num_output: 58 423 | bias_term: false 424 | pad: 0 425 | kernel_size: 1 426 | group: 1 427 | stride: 1 428 | weight_filler { 429 | type: "msra" 430 | } 431 | dilation: 1 432 | } 433 | } 434 | layer { 435 | name: "stage_2_1/conv3/bn" 436 | type: "BatchNorm" 437 | bottom: "stage_2_1/conv3" 438 | top: "stage_2_1/conv3" 439 | param { 440 | lr_mult: 0.0 441 | decay_mult: 0.0 442 | } 443 | param { 444 | lr_mult: 0.0 445 | decay_mult: 0.0 446 | } 447 | param { 448 | lr_mult: 0.0 449 | decay_mult: 0.0 450 | } 451 | } 452 | layer { 453 | name: "stage_2_1/conv3/bn/scale" 454 | type: "Scale" 455 | bottom: "stage_2_1/conv3" 456 | top: "stage_2_1/conv3" 457 | param { 458 | lr_mult: 1.0 459 | decay_mult: 0.0 460 | } 461 | param { 462 | lr_mult: 1.0 463 | decay_mult: 0.0 464 | } 465 | scale_param { 466 | filler { 467 | type: "constant" 468 | value: 1.0 469 | } 470 | bias_term: true 471 | bias_filler { 472 | type: "constant" 473 | value: 0.0 474 | } 475 | } 476 | } 477 | layer { 478 | name: "stage_2_1/conv3/relu" 479 | type: "ReLU" 480 | bottom: "stage_2_1/conv3" 481 | top: "stage_2_1/conv3" 482 | } 483 | layer { 484 | name: "stage_2_1/concat" 485 | type: "Concat" 486 | bottom: "stage_2_1/conv5" 487 | bottom: "stage_2_1/conv3" 488 | top: "stage_2_1/concat" 489 | concat_param { 490 | axis: 1 491 | } 492 | } 493 | layer { 494 | name: "stage_2_1/shuffle" 495 | type: "ShuffleChannel" 496 | bottom: "stage_2_1/concat" 497 | top: "stage_2_1/shuffle" 498 | shuffle_channel_param { 499 | group: 2 500 | } 501 | } 502 | layer { 503 | name: "stage_2_2/slice1" 504 | type: "Slice" 505 | bottom: "stage_2_1/shuffle" 506 | top: "stage_2_2/slice1" 507 | top: "stage_2_2/slice2" 508 | slice_param { 509 | slice_point: 58 510 | axis: 1 511 | } 512 | } 513 | layer { 514 | name: "stage_2_2/conv1" 515 | type: "Convolution" 516 | bottom: "stage_2_2/slice2" 517 | top: "stage_2_2/conv1" 518 | param { 519 | lr_mult: 1.0 520 | decay_mult: 1.0 521 | } 522 | convolution_param { 523 | num_output: 58 524 | bias_term: false 525 | pad: 0 526 | kernel_size: 1 527 | group: 1 528 | stride: 1 529 | weight_filler { 530 | type: "msra" 531 | } 532 | dilation: 1 533 | } 534 | } 535 | layer { 536 | name: "stage_2_2/conv1/bn" 537 | type: "BatchNorm" 538 | bottom: "stage_2_2/conv1" 539 | top: "stage_2_2/conv1" 540 | param { 541 | lr_mult: 0.0 542 | decay_mult: 0.0 543 | } 544 | param { 545 | lr_mult: 0.0 546 | decay_mult: 0.0 547 | } 548 | param { 549 | lr_mult: 0.0 550 | decay_mult: 0.0 551 | } 552 | } 553 | layer { 554 | name: "stage_2_2/conv1/bn/scale" 555 | type: "Scale" 556 | bottom: "stage_2_2/conv1" 557 | top: "stage_2_2/conv1" 558 | param { 559 | lr_mult: 1.0 560 | decay_mult: 0.0 561 | } 562 | param { 563 | lr_mult: 1.0 564 | decay_mult: 0.0 565 | } 566 | scale_param { 567 | filler { 568 | type: "constant" 569 | value: 1.0 570 | } 571 | bias_term: true 572 | bias_filler { 573 | type: "constant" 574 | value: 0.0 575 | } 576 | } 577 | } 578 | layer { 579 | name: "stage_2_2/conv1/relu" 580 | type: "ReLU" 581 | bottom: "stage_2_2/conv1" 582 | top: "stage_2_2/conv1" 583 | } 584 | layer { 585 | name: "stage_2_2/conv2" 586 | type: "Convolution" 587 | bottom: "stage_2_2/conv1" 588 | top: "stage_2_2/conv2" 589 | param { 590 | lr_mult: 1.0 591 | decay_mult: 1.0 592 | } 593 | convolution_param { 594 | num_output: 58 595 | bias_term: false 596 | pad: 1 597 | kernel_size: 3 598 | group: 58 599 | stride: 1 600 | weight_filler { 601 | type: "msra" 602 | } 603 | dilation: 1 604 | } 605 | } 606 | layer { 607 | name: "stage_2_2/conv2/bn" 608 | type: "BatchNorm" 609 | bottom: "stage_2_2/conv2" 610 | top: "stage_2_2/conv2" 611 | param { 612 | lr_mult: 0.0 613 | decay_mult: 0.0 614 | } 615 | param { 616 | lr_mult: 0.0 617 | decay_mult: 0.0 618 | } 619 | param { 620 | lr_mult: 0.0 621 | decay_mult: 0.0 622 | } 623 | } 624 | layer { 625 | name: "stage_2_2/conv2/bn/scale" 626 | type: "Scale" 627 | bottom: "stage_2_2/conv2" 628 | top: "stage_2_2/conv2" 629 | param { 630 | lr_mult: 1.0 631 | decay_mult: 0.0 632 | } 633 | param { 634 | lr_mult: 1.0 635 | decay_mult: 0.0 636 | } 637 | scale_param { 638 | filler { 639 | type: "constant" 640 | value: 1.0 641 | } 642 | bias_term: true 643 | bias_filler { 644 | type: "constant" 645 | value: 0.0 646 | } 647 | } 648 | } 649 | layer { 650 | name: "stage_2_2/conv3" 651 | type: "Convolution" 652 | bottom: "stage_2_2/conv2" 653 | top: "stage_2_2/conv3" 654 | param { 655 | lr_mult: 1.0 656 | decay_mult: 1.0 657 | } 658 | convolution_param { 659 | num_output: 58 660 | bias_term: false 661 | pad: 0 662 | kernel_size: 1 663 | group: 1 664 | stride: 1 665 | weight_filler { 666 | type: "msra" 667 | } 668 | dilation: 1 669 | } 670 | } 671 | layer { 672 | name: "stage_2_2/conv3/bn" 673 | type: "BatchNorm" 674 | bottom: "stage_2_2/conv3" 675 | top: "stage_2_2/conv3" 676 | param { 677 | lr_mult: 0.0 678 | decay_mult: 0.0 679 | } 680 | param { 681 | lr_mult: 0.0 682 | decay_mult: 0.0 683 | } 684 | param { 685 | lr_mult: 0.0 686 | decay_mult: 0.0 687 | } 688 | } 689 | layer { 690 | name: "stage_2_2/conv3/bn/scale" 691 | type: "Scale" 692 | bottom: "stage_2_2/conv3" 693 | top: "stage_2_2/conv3" 694 | param { 695 | lr_mult: 1.0 696 | decay_mult: 0.0 697 | } 698 | param { 699 | lr_mult: 1.0 700 | decay_mult: 0.0 701 | } 702 | scale_param { 703 | filler { 704 | type: "constant" 705 | value: 1.0 706 | } 707 | bias_term: true 708 | bias_filler { 709 | type: "constant" 710 | value: 0.0 711 | } 712 | } 713 | } 714 | layer { 715 | name: "stage_2_2/conv3/relu" 716 | type: "ReLU" 717 | bottom: "stage_2_2/conv3" 718 | top: "stage_2_2/conv3" 719 | } 720 | layer { 721 | name: "stage_2_2/concat" 722 | type: "Concat" 723 | bottom: "stage_2_2/slice1" 724 | bottom: "stage_2_2/conv3" 725 | top: "stage_2_2/concat" 726 | concat_param { 727 | axis: 1 728 | } 729 | } 730 | layer { 731 | name: "stage_2_2/shuffle" 732 | type: "ShuffleChannel" 733 | bottom: "stage_2_2/concat" 734 | top: "stage_2_2/shuffle" 735 | shuffle_channel_param { 736 | group: 2 737 | } 738 | } 739 | layer { 740 | name: "stage_2_3/slice1" 741 | type: "Slice" 742 | bottom: "stage_2_2/shuffle" 743 | top: "stage_2_3/slice1" 744 | top: "stage_2_3/slice2" 745 | slice_param { 746 | slice_point: 58 747 | axis: 1 748 | } 749 | } 750 | layer { 751 | name: "stage_2_3/conv1" 752 | type: "Convolution" 753 | bottom: "stage_2_3/slice2" 754 | top: "stage_2_3/conv1" 755 | param { 756 | lr_mult: 1.0 757 | decay_mult: 1.0 758 | } 759 | convolution_param { 760 | num_output: 58 761 | bias_term: false 762 | pad: 0 763 | kernel_size: 1 764 | group: 1 765 | stride: 1 766 | weight_filler { 767 | type: "msra" 768 | } 769 | dilation: 1 770 | } 771 | } 772 | layer { 773 | name: "stage_2_3/conv1/bn" 774 | type: "BatchNorm" 775 | bottom: "stage_2_3/conv1" 776 | top: "stage_2_3/conv1" 777 | param { 778 | lr_mult: 0.0 779 | decay_mult: 0.0 780 | } 781 | param { 782 | lr_mult: 0.0 783 | decay_mult: 0.0 784 | } 785 | param { 786 | lr_mult: 0.0 787 | decay_mult: 0.0 788 | } 789 | } 790 | layer { 791 | name: "stage_2_3/conv1/bn/scale" 792 | type: "Scale" 793 | bottom: "stage_2_3/conv1" 794 | top: "stage_2_3/conv1" 795 | param { 796 | lr_mult: 1.0 797 | decay_mult: 0.0 798 | } 799 | param { 800 | lr_mult: 1.0 801 | decay_mult: 0.0 802 | } 803 | scale_param { 804 | filler { 805 | type: "constant" 806 | value: 1.0 807 | } 808 | bias_term: true 809 | bias_filler { 810 | type: "constant" 811 | value: 0.0 812 | } 813 | } 814 | } 815 | layer { 816 | name: "stage_2_3/conv1/relu" 817 | type: "ReLU" 818 | bottom: "stage_2_3/conv1" 819 | top: "stage_2_3/conv1" 820 | } 821 | layer { 822 | name: "stage_2_3/conv2" 823 | type: "Convolution" 824 | bottom: "stage_2_3/conv1" 825 | top: "stage_2_3/conv2" 826 | param { 827 | lr_mult: 1.0 828 | decay_mult: 1.0 829 | } 830 | convolution_param { 831 | num_output: 58 832 | bias_term: false 833 | pad: 1 834 | kernel_size: 3 835 | group: 58 836 | stride: 1 837 | weight_filler { 838 | type: "msra" 839 | } 840 | dilation: 1 841 | } 842 | } 843 | layer { 844 | name: "stage_2_3/conv2/bn" 845 | type: "BatchNorm" 846 | bottom: "stage_2_3/conv2" 847 | top: "stage_2_3/conv2" 848 | param { 849 | lr_mult: 0.0 850 | decay_mult: 0.0 851 | } 852 | param { 853 | lr_mult: 0.0 854 | decay_mult: 0.0 855 | } 856 | param { 857 | lr_mult: 0.0 858 | decay_mult: 0.0 859 | } 860 | } 861 | layer { 862 | name: "stage_2_3/conv2/bn/scale" 863 | type: "Scale" 864 | bottom: "stage_2_3/conv2" 865 | top: "stage_2_3/conv2" 866 | param { 867 | lr_mult: 1.0 868 | decay_mult: 0.0 869 | } 870 | param { 871 | lr_mult: 1.0 872 | decay_mult: 0.0 873 | } 874 | scale_param { 875 | filler { 876 | type: "constant" 877 | value: 1.0 878 | } 879 | bias_term: true 880 | bias_filler { 881 | type: "constant" 882 | value: 0.0 883 | } 884 | } 885 | } 886 | layer { 887 | name: "stage_2_3/conv3" 888 | type: "Convolution" 889 | bottom: "stage_2_3/conv2" 890 | top: "stage_2_3/conv3" 891 | param { 892 | lr_mult: 1.0 893 | decay_mult: 1.0 894 | } 895 | convolution_param { 896 | num_output: 58 897 | bias_term: false 898 | pad: 0 899 | kernel_size: 1 900 | group: 1 901 | stride: 1 902 | weight_filler { 903 | type: "msra" 904 | } 905 | dilation: 1 906 | } 907 | } 908 | layer { 909 | name: "stage_2_3/conv3/bn" 910 | type: "BatchNorm" 911 | bottom: "stage_2_3/conv3" 912 | top: "stage_2_3/conv3" 913 | param { 914 | lr_mult: 0.0 915 | decay_mult: 0.0 916 | } 917 | param { 918 | lr_mult: 0.0 919 | decay_mult: 0.0 920 | } 921 | param { 922 | lr_mult: 0.0 923 | decay_mult: 0.0 924 | } 925 | } 926 | layer { 927 | name: "stage_2_3/conv3/bn/scale" 928 | type: "Scale" 929 | bottom: "stage_2_3/conv3" 930 | top: "stage_2_3/conv3" 931 | param { 932 | lr_mult: 1.0 933 | decay_mult: 0.0 934 | } 935 | param { 936 | lr_mult: 1.0 937 | decay_mult: 0.0 938 | } 939 | scale_param { 940 | filler { 941 | type: "constant" 942 | value: 1.0 943 | } 944 | bias_term: true 945 | bias_filler { 946 | type: "constant" 947 | value: 0.0 948 | } 949 | } 950 | } 951 | layer { 952 | name: "stage_2_3/conv3/relu" 953 | type: "ReLU" 954 | bottom: "stage_2_3/conv3" 955 | top: "stage_2_3/conv3" 956 | } 957 | layer { 958 | name: "stage_2_3/concat" 959 | type: "Concat" 960 | bottom: "stage_2_3/slice1" 961 | bottom: "stage_2_3/conv3" 962 | top: "stage_2_3/concat" 963 | concat_param { 964 | axis: 1 965 | } 966 | } 967 | layer { 968 | name: "stage_2_3/shuffle" 969 | type: "ShuffleChannel" 970 | bottom: "stage_2_3/concat" 971 | top: "stage_2_3/shuffle" 972 | shuffle_channel_param { 973 | group: 2 974 | } 975 | } 976 | layer { 977 | name: "stage_2_4/slice1" 978 | type: "Slice" 979 | bottom: "stage_2_3/shuffle" 980 | top: "stage_2_4/slice1" 981 | top: "stage_2_4/slice2" 982 | slice_param { 983 | slice_point: 58 984 | axis: 1 985 | } 986 | } 987 | layer { 988 | name: "stage_2_4/conv1" 989 | type: "Convolution" 990 | bottom: "stage_2_4/slice2" 991 | top: "stage_2_4/conv1" 992 | param { 993 | lr_mult: 1.0 994 | decay_mult: 1.0 995 | } 996 | convolution_param { 997 | num_output: 58 998 | bias_term: false 999 | pad: 0 1000 | kernel_size: 1 1001 | group: 1 1002 | stride: 1 1003 | weight_filler { 1004 | type: "msra" 1005 | } 1006 | dilation: 1 1007 | } 1008 | } 1009 | layer { 1010 | name: "stage_2_4/conv1/bn" 1011 | type: "BatchNorm" 1012 | bottom: "stage_2_4/conv1" 1013 | top: "stage_2_4/conv1" 1014 | param { 1015 | lr_mult: 0.0 1016 | decay_mult: 0.0 1017 | } 1018 | param { 1019 | lr_mult: 0.0 1020 | decay_mult: 0.0 1021 | } 1022 | param { 1023 | lr_mult: 0.0 1024 | decay_mult: 0.0 1025 | } 1026 | } 1027 | layer { 1028 | name: "stage_2_4/conv1/bn/scale" 1029 | type: "Scale" 1030 | bottom: "stage_2_4/conv1" 1031 | top: "stage_2_4/conv1" 1032 | param { 1033 | lr_mult: 1.0 1034 | decay_mult: 0.0 1035 | } 1036 | param { 1037 | lr_mult: 1.0 1038 | decay_mult: 0.0 1039 | } 1040 | scale_param { 1041 | filler { 1042 | type: "constant" 1043 | value: 1.0 1044 | } 1045 | bias_term: true 1046 | bias_filler { 1047 | type: "constant" 1048 | value: 0.0 1049 | } 1050 | } 1051 | } 1052 | layer { 1053 | name: "stage_2_4/conv1/relu" 1054 | type: "ReLU" 1055 | bottom: "stage_2_4/conv1" 1056 | top: "stage_2_4/conv1" 1057 | } 1058 | layer { 1059 | name: "stage_2_4/conv2" 1060 | type: "Convolution" 1061 | bottom: "stage_2_4/conv1" 1062 | top: "stage_2_4/conv2" 1063 | param { 1064 | lr_mult: 1.0 1065 | decay_mult: 1.0 1066 | } 1067 | convolution_param { 1068 | num_output: 58 1069 | bias_term: false 1070 | pad: 1 1071 | kernel_size: 3 1072 | group: 58 1073 | stride: 1 1074 | weight_filler { 1075 | type: "msra" 1076 | } 1077 | dilation: 1 1078 | } 1079 | } 1080 | layer { 1081 | name: "stage_2_4/conv2/bn" 1082 | type: "BatchNorm" 1083 | bottom: "stage_2_4/conv2" 1084 | top: "stage_2_4/conv2" 1085 | param { 1086 | lr_mult: 0.0 1087 | decay_mult: 0.0 1088 | } 1089 | param { 1090 | lr_mult: 0.0 1091 | decay_mult: 0.0 1092 | } 1093 | param { 1094 | lr_mult: 0.0 1095 | decay_mult: 0.0 1096 | } 1097 | } 1098 | layer { 1099 | name: "stage_2_4/conv2/bn/scale" 1100 | type: "Scale" 1101 | bottom: "stage_2_4/conv2" 1102 | top: "stage_2_4/conv2" 1103 | param { 1104 | lr_mult: 1.0 1105 | decay_mult: 0.0 1106 | } 1107 | param { 1108 | lr_mult: 1.0 1109 | decay_mult: 0.0 1110 | } 1111 | scale_param { 1112 | filler { 1113 | type: "constant" 1114 | value: 1.0 1115 | } 1116 | bias_term: true 1117 | bias_filler { 1118 | type: "constant" 1119 | value: 0.0 1120 | } 1121 | } 1122 | } 1123 | layer { 1124 | name: "stage_2_4/conv3" 1125 | type: "Convolution" 1126 | bottom: "stage_2_4/conv2" 1127 | top: "stage_2_4/conv3" 1128 | param { 1129 | lr_mult: 1.0 1130 | decay_mult: 1.0 1131 | } 1132 | convolution_param { 1133 | num_output: 58 1134 | bias_term: false 1135 | pad: 0 1136 | kernel_size: 1 1137 | group: 1 1138 | stride: 1 1139 | weight_filler { 1140 | type: "msra" 1141 | } 1142 | dilation: 1 1143 | } 1144 | } 1145 | layer { 1146 | name: "stage_2_4/conv3/bn" 1147 | type: "BatchNorm" 1148 | bottom: "stage_2_4/conv3" 1149 | top: "stage_2_4/conv3" 1150 | param { 1151 | lr_mult: 0.0 1152 | decay_mult: 0.0 1153 | } 1154 | param { 1155 | lr_mult: 0.0 1156 | decay_mult: 0.0 1157 | } 1158 | param { 1159 | lr_mult: 0.0 1160 | decay_mult: 0.0 1161 | } 1162 | } 1163 | layer { 1164 | name: "stage_2_4/conv3/bn/scale" 1165 | type: "Scale" 1166 | bottom: "stage_2_4/conv3" 1167 | top: "stage_2_4/conv3" 1168 | param { 1169 | lr_mult: 1.0 1170 | decay_mult: 0.0 1171 | } 1172 | param { 1173 | lr_mult: 1.0 1174 | decay_mult: 0.0 1175 | } 1176 | scale_param { 1177 | filler { 1178 | type: "constant" 1179 | value: 1.0 1180 | } 1181 | bias_term: true 1182 | bias_filler { 1183 | type: "constant" 1184 | value: 0.0 1185 | } 1186 | } 1187 | } 1188 | layer { 1189 | name: "stage_2_4/conv3/relu" 1190 | type: "ReLU" 1191 | bottom: "stage_2_4/conv3" 1192 | top: "stage_2_4/conv3" 1193 | } 1194 | layer { 1195 | name: "stage_2_4/concat" 1196 | type: "Concat" 1197 | bottom: "stage_2_4/slice1" 1198 | bottom: "stage_2_4/conv3" 1199 | top: "stage_2_4/concat" 1200 | concat_param { 1201 | axis: 1 1202 | } 1203 | } 1204 | layer { 1205 | name: "stage_2_4/shuffle" 1206 | type: "ShuffleChannel" 1207 | bottom: "stage_2_4/concat" 1208 | top: "stage_2_4/shuffle" 1209 | shuffle_channel_param { 1210 | group: 2 1211 | } 1212 | } 1213 | layer { 1214 | name: "stage_3_1/conv4" 1215 | type: "Convolution" 1216 | bottom: "stage_2_4/shuffle" 1217 | top: "stage_3_1/conv4" 1218 | param { 1219 | lr_mult: 1.0 1220 | decay_mult: 1.0 1221 | } 1222 | convolution_param { 1223 | num_output: 116 1224 | bias_term: false 1225 | pad: 1 1226 | kernel_size: 3 1227 | group: 116 1228 | stride: 2 1229 | weight_filler { 1230 | type: "msra" 1231 | } 1232 | dilation: 1 1233 | } 1234 | } 1235 | layer { 1236 | name: "stage_3_1/conv4/bn" 1237 | type: "BatchNorm" 1238 | bottom: "stage_3_1/conv4" 1239 | top: "stage_3_1/conv4" 1240 | param { 1241 | lr_mult: 0.0 1242 | decay_mult: 0.0 1243 | } 1244 | param { 1245 | lr_mult: 0.0 1246 | decay_mult: 0.0 1247 | } 1248 | param { 1249 | lr_mult: 0.0 1250 | decay_mult: 0.0 1251 | } 1252 | } 1253 | layer { 1254 | name: "stage_3_1/conv4/bn/scale" 1255 | type: "Scale" 1256 | bottom: "stage_3_1/conv4" 1257 | top: "stage_3_1/conv4" 1258 | param { 1259 | lr_mult: 1.0 1260 | decay_mult: 0.0 1261 | } 1262 | param { 1263 | lr_mult: 1.0 1264 | decay_mult: 0.0 1265 | } 1266 | scale_param { 1267 | filler { 1268 | type: "constant" 1269 | value: 1.0 1270 | } 1271 | bias_term: true 1272 | bias_filler { 1273 | type: "constant" 1274 | value: 0.0 1275 | } 1276 | } 1277 | } 1278 | layer { 1279 | name: "stage_3_1/conv5" 1280 | type: "Convolution" 1281 | bottom: "stage_3_1/conv4" 1282 | top: "stage_3_1/conv5" 1283 | param { 1284 | lr_mult: 1.0 1285 | decay_mult: 1.0 1286 | } 1287 | convolution_param { 1288 | num_output: 116 1289 | bias_term: false 1290 | pad: 0 1291 | kernel_size: 1 1292 | group: 1 1293 | stride: 1 1294 | weight_filler { 1295 | type: "msra" 1296 | } 1297 | dilation: 1 1298 | } 1299 | } 1300 | layer { 1301 | name: "stage_3_1/conv5/bn" 1302 | type: "BatchNorm" 1303 | bottom: "stage_3_1/conv5" 1304 | top: "stage_3_1/conv5" 1305 | param { 1306 | lr_mult: 0.0 1307 | decay_mult: 0.0 1308 | } 1309 | param { 1310 | lr_mult: 0.0 1311 | decay_mult: 0.0 1312 | } 1313 | param { 1314 | lr_mult: 0.0 1315 | decay_mult: 0.0 1316 | } 1317 | } 1318 | layer { 1319 | name: "stage_3_1/conv5/bn/scale" 1320 | type: "Scale" 1321 | bottom: "stage_3_1/conv5" 1322 | top: "stage_3_1/conv5" 1323 | param { 1324 | lr_mult: 1.0 1325 | decay_mult: 0.0 1326 | } 1327 | param { 1328 | lr_mult: 1.0 1329 | decay_mult: 0.0 1330 | } 1331 | scale_param { 1332 | filler { 1333 | type: "constant" 1334 | value: 1.0 1335 | } 1336 | bias_term: true 1337 | bias_filler { 1338 | type: "constant" 1339 | value: 0.0 1340 | } 1341 | } 1342 | } 1343 | layer { 1344 | name: "stage_3_1/conv5/relu" 1345 | type: "ReLU" 1346 | bottom: "stage_3_1/conv5" 1347 | top: "stage_3_1/conv5" 1348 | } 1349 | layer { 1350 | name: "stage_3_1/conv1" 1351 | type: "Convolution" 1352 | bottom: "stage_2_4/shuffle" 1353 | top: "stage_3_1/conv1" 1354 | param { 1355 | lr_mult: 1.0 1356 | decay_mult: 1.0 1357 | } 1358 | convolution_param { 1359 | num_output: 116 1360 | bias_term: false 1361 | pad: 0 1362 | kernel_size: 1 1363 | group: 1 1364 | stride: 1 1365 | weight_filler { 1366 | type: "msra" 1367 | } 1368 | dilation: 1 1369 | } 1370 | } 1371 | layer { 1372 | name: "stage_3_1/conv1/bn" 1373 | type: "BatchNorm" 1374 | bottom: "stage_3_1/conv1" 1375 | top: "stage_3_1/conv1" 1376 | param { 1377 | lr_mult: 0.0 1378 | decay_mult: 0.0 1379 | } 1380 | param { 1381 | lr_mult: 0.0 1382 | decay_mult: 0.0 1383 | } 1384 | param { 1385 | lr_mult: 0.0 1386 | decay_mult: 0.0 1387 | } 1388 | } 1389 | layer { 1390 | name: "stage_3_1/conv1/bn/scale" 1391 | type: "Scale" 1392 | bottom: "stage_3_1/conv1" 1393 | top: "stage_3_1/conv1" 1394 | param { 1395 | lr_mult: 1.0 1396 | decay_mult: 0.0 1397 | } 1398 | param { 1399 | lr_mult: 1.0 1400 | decay_mult: 0.0 1401 | } 1402 | scale_param { 1403 | filler { 1404 | type: "constant" 1405 | value: 1.0 1406 | } 1407 | bias_term: true 1408 | bias_filler { 1409 | type: "constant" 1410 | value: 0.0 1411 | } 1412 | } 1413 | } 1414 | layer { 1415 | name: "stage_3_1/conv1/relu" 1416 | type: "ReLU" 1417 | bottom: "stage_3_1/conv1" 1418 | top: "stage_3_1/conv1" 1419 | } 1420 | layer { 1421 | name: "stage_3_1/conv2" 1422 | type: "Convolution" 1423 | bottom: "stage_3_1/conv1" 1424 | top: "stage_3_1/conv2" 1425 | param { 1426 | lr_mult: 1.0 1427 | decay_mult: 1.0 1428 | } 1429 | convolution_param { 1430 | num_output: 116 1431 | bias_term: false 1432 | pad: 1 1433 | kernel_size: 3 1434 | group: 116 1435 | stride: 2 1436 | weight_filler { 1437 | type: "msra" 1438 | } 1439 | dilation: 1 1440 | } 1441 | } 1442 | layer { 1443 | name: "stage_3_1/conv2/bn" 1444 | type: "BatchNorm" 1445 | bottom: "stage_3_1/conv2" 1446 | top: "stage_3_1/conv2" 1447 | param { 1448 | lr_mult: 0.0 1449 | decay_mult: 0.0 1450 | } 1451 | param { 1452 | lr_mult: 0.0 1453 | decay_mult: 0.0 1454 | } 1455 | param { 1456 | lr_mult: 0.0 1457 | decay_mult: 0.0 1458 | } 1459 | } 1460 | layer { 1461 | name: "stage_3_1/conv2/bn/scale" 1462 | type: "Scale" 1463 | bottom: "stage_3_1/conv2" 1464 | top: "stage_3_1/conv2" 1465 | param { 1466 | lr_mult: 1.0 1467 | decay_mult: 0.0 1468 | } 1469 | param { 1470 | lr_mult: 1.0 1471 | decay_mult: 0.0 1472 | } 1473 | scale_param { 1474 | filler { 1475 | type: "constant" 1476 | value: 1.0 1477 | } 1478 | bias_term: true 1479 | bias_filler { 1480 | type: "constant" 1481 | value: 0.0 1482 | } 1483 | } 1484 | } 1485 | layer { 1486 | name: "stage_3_1/conv3" 1487 | type: "Convolution" 1488 | bottom: "stage_3_1/conv2" 1489 | top: "stage_3_1/conv3" 1490 | param { 1491 | lr_mult: 1.0 1492 | decay_mult: 1.0 1493 | } 1494 | convolution_param { 1495 | num_output: 116 1496 | bias_term: false 1497 | pad: 0 1498 | kernel_size: 1 1499 | group: 1 1500 | stride: 1 1501 | weight_filler { 1502 | type: "msra" 1503 | } 1504 | dilation: 1 1505 | } 1506 | } 1507 | layer { 1508 | name: "stage_3_1/conv3/bn" 1509 | type: "BatchNorm" 1510 | bottom: "stage_3_1/conv3" 1511 | top: "stage_3_1/conv3" 1512 | param { 1513 | lr_mult: 0.0 1514 | decay_mult: 0.0 1515 | } 1516 | param { 1517 | lr_mult: 0.0 1518 | decay_mult: 0.0 1519 | } 1520 | param { 1521 | lr_mult: 0.0 1522 | decay_mult: 0.0 1523 | } 1524 | } 1525 | layer { 1526 | name: "stage_3_1/conv3/bn/scale" 1527 | type: "Scale" 1528 | bottom: "stage_3_1/conv3" 1529 | top: "stage_3_1/conv3" 1530 | param { 1531 | lr_mult: 1.0 1532 | decay_mult: 0.0 1533 | } 1534 | param { 1535 | lr_mult: 1.0 1536 | decay_mult: 0.0 1537 | } 1538 | scale_param { 1539 | filler { 1540 | type: "constant" 1541 | value: 1.0 1542 | } 1543 | bias_term: true 1544 | bias_filler { 1545 | type: "constant" 1546 | value: 0.0 1547 | } 1548 | } 1549 | } 1550 | layer { 1551 | name: "stage_3_1/conv3/relu" 1552 | type: "ReLU" 1553 | bottom: "stage_3_1/conv3" 1554 | top: "stage_3_1/conv3" 1555 | } 1556 | layer { 1557 | name: "stage_3_1/concat" 1558 | type: "Concat" 1559 | bottom: "stage_3_1/conv5" 1560 | bottom: "stage_3_1/conv3" 1561 | top: "stage_3_1/concat" 1562 | concat_param { 1563 | axis: 1 1564 | } 1565 | } 1566 | layer { 1567 | name: "stage_3_1/shuffle" 1568 | type: "ShuffleChannel" 1569 | bottom: "stage_3_1/concat" 1570 | top: "stage_3_1/shuffle" 1571 | shuffle_channel_param { 1572 | group: 2 1573 | } 1574 | } 1575 | layer { 1576 | name: "stage_3_2/slice1" 1577 | type: "Slice" 1578 | bottom: "stage_3_1/shuffle" 1579 | top: "stage_3_2/slice1" 1580 | top: "stage_3_2/slice2" 1581 | slice_param { 1582 | slice_point: 116 1583 | axis: 1 1584 | } 1585 | } 1586 | layer { 1587 | name: "stage_3_2/conv1" 1588 | type: "Convolution" 1589 | bottom: "stage_3_2/slice2" 1590 | top: "stage_3_2/conv1" 1591 | param { 1592 | lr_mult: 1.0 1593 | decay_mult: 1.0 1594 | } 1595 | convolution_param { 1596 | num_output: 116 1597 | bias_term: false 1598 | pad: 0 1599 | kernel_size: 1 1600 | group: 1 1601 | stride: 1 1602 | weight_filler { 1603 | type: "msra" 1604 | } 1605 | dilation: 1 1606 | } 1607 | } 1608 | layer { 1609 | name: "stage_3_2/conv1/bn" 1610 | type: "BatchNorm" 1611 | bottom: "stage_3_2/conv1" 1612 | top: "stage_3_2/conv1" 1613 | param { 1614 | lr_mult: 0.0 1615 | decay_mult: 0.0 1616 | } 1617 | param { 1618 | lr_mult: 0.0 1619 | decay_mult: 0.0 1620 | } 1621 | param { 1622 | lr_mult: 0.0 1623 | decay_mult: 0.0 1624 | } 1625 | } 1626 | layer { 1627 | name: "stage_3_2/conv1/bn/scale" 1628 | type: "Scale" 1629 | bottom: "stage_3_2/conv1" 1630 | top: "stage_3_2/conv1" 1631 | param { 1632 | lr_mult: 1.0 1633 | decay_mult: 0.0 1634 | } 1635 | param { 1636 | lr_mult: 1.0 1637 | decay_mult: 0.0 1638 | } 1639 | scale_param { 1640 | filler { 1641 | type: "constant" 1642 | value: 1.0 1643 | } 1644 | bias_term: true 1645 | bias_filler { 1646 | type: "constant" 1647 | value: 0.0 1648 | } 1649 | } 1650 | } 1651 | layer { 1652 | name: "stage_3_2/conv1/relu" 1653 | type: "ReLU" 1654 | bottom: "stage_3_2/conv1" 1655 | top: "stage_3_2/conv1" 1656 | } 1657 | layer { 1658 | name: "stage_3_2/conv2" 1659 | type: "Convolution" 1660 | bottom: "stage_3_2/conv1" 1661 | top: "stage_3_2/conv2" 1662 | param { 1663 | lr_mult: 1.0 1664 | decay_mult: 1.0 1665 | } 1666 | convolution_param { 1667 | num_output: 116 1668 | bias_term: false 1669 | pad: 1 1670 | kernel_size: 3 1671 | group: 116 1672 | stride: 1 1673 | weight_filler { 1674 | type: "msra" 1675 | } 1676 | dilation: 1 1677 | } 1678 | } 1679 | layer { 1680 | name: "stage_3_2/conv2/bn" 1681 | type: "BatchNorm" 1682 | bottom: "stage_3_2/conv2" 1683 | top: "stage_3_2/conv2" 1684 | param { 1685 | lr_mult: 0.0 1686 | decay_mult: 0.0 1687 | } 1688 | param { 1689 | lr_mult: 0.0 1690 | decay_mult: 0.0 1691 | } 1692 | param { 1693 | lr_mult: 0.0 1694 | decay_mult: 0.0 1695 | } 1696 | } 1697 | layer { 1698 | name: "stage_3_2/conv2/bn/scale" 1699 | type: "Scale" 1700 | bottom: "stage_3_2/conv2" 1701 | top: "stage_3_2/conv2" 1702 | param { 1703 | lr_mult: 1.0 1704 | decay_mult: 0.0 1705 | } 1706 | param { 1707 | lr_mult: 1.0 1708 | decay_mult: 0.0 1709 | } 1710 | scale_param { 1711 | filler { 1712 | type: "constant" 1713 | value: 1.0 1714 | } 1715 | bias_term: true 1716 | bias_filler { 1717 | type: "constant" 1718 | value: 0.0 1719 | } 1720 | } 1721 | } 1722 | layer { 1723 | name: "stage_3_2/conv3" 1724 | type: "Convolution" 1725 | bottom: "stage_3_2/conv2" 1726 | top: "stage_3_2/conv3" 1727 | param { 1728 | lr_mult: 1.0 1729 | decay_mult: 1.0 1730 | } 1731 | convolution_param { 1732 | num_output: 116 1733 | bias_term: false 1734 | pad: 0 1735 | kernel_size: 1 1736 | group: 1 1737 | stride: 1 1738 | weight_filler { 1739 | type: "msra" 1740 | } 1741 | dilation: 1 1742 | } 1743 | } 1744 | layer { 1745 | name: "stage_3_2/conv3/bn" 1746 | type: "BatchNorm" 1747 | bottom: "stage_3_2/conv3" 1748 | top: "stage_3_2/conv3" 1749 | param { 1750 | lr_mult: 0.0 1751 | decay_mult: 0.0 1752 | } 1753 | param { 1754 | lr_mult: 0.0 1755 | decay_mult: 0.0 1756 | } 1757 | param { 1758 | lr_mult: 0.0 1759 | decay_mult: 0.0 1760 | } 1761 | } 1762 | layer { 1763 | name: "stage_3_2/conv3/bn/scale" 1764 | type: "Scale" 1765 | bottom: "stage_3_2/conv3" 1766 | top: "stage_3_2/conv3" 1767 | param { 1768 | lr_mult: 1.0 1769 | decay_mult: 0.0 1770 | } 1771 | param { 1772 | lr_mult: 1.0 1773 | decay_mult: 0.0 1774 | } 1775 | scale_param { 1776 | filler { 1777 | type: "constant" 1778 | value: 1.0 1779 | } 1780 | bias_term: true 1781 | bias_filler { 1782 | type: "constant" 1783 | value: 0.0 1784 | } 1785 | } 1786 | } 1787 | layer { 1788 | name: "stage_3_2/conv3/relu" 1789 | type: "ReLU" 1790 | bottom: "stage_3_2/conv3" 1791 | top: "stage_3_2/conv3" 1792 | } 1793 | layer { 1794 | name: "stage_3_2/concat" 1795 | type: "Concat" 1796 | bottom: "stage_3_2/slice1" 1797 | bottom: "stage_3_2/conv3" 1798 | top: "stage_3_2/concat" 1799 | concat_param { 1800 | axis: 1 1801 | } 1802 | } 1803 | layer { 1804 | name: "stage_3_2/shuffle" 1805 | type: "ShuffleChannel" 1806 | bottom: "stage_3_2/concat" 1807 | top: "stage_3_2/shuffle" 1808 | shuffle_channel_param { 1809 | group: 2 1810 | } 1811 | } 1812 | layer { 1813 | name: "stage_3_3/slice1" 1814 | type: "Slice" 1815 | bottom: "stage_3_2/shuffle" 1816 | top: "stage_3_3/slice1" 1817 | top: "stage_3_3/slice2" 1818 | slice_param { 1819 | slice_point: 116 1820 | axis: 1 1821 | } 1822 | } 1823 | layer { 1824 | name: "stage_3_3/conv1" 1825 | type: "Convolution" 1826 | bottom: "stage_3_3/slice2" 1827 | top: "stage_3_3/conv1" 1828 | param { 1829 | lr_mult: 1.0 1830 | decay_mult: 1.0 1831 | } 1832 | convolution_param { 1833 | num_output: 116 1834 | bias_term: false 1835 | pad: 0 1836 | kernel_size: 1 1837 | group: 1 1838 | stride: 1 1839 | weight_filler { 1840 | type: "msra" 1841 | } 1842 | dilation: 1 1843 | } 1844 | } 1845 | layer { 1846 | name: "stage_3_3/conv1/bn" 1847 | type: "BatchNorm" 1848 | bottom: "stage_3_3/conv1" 1849 | top: "stage_3_3/conv1" 1850 | param { 1851 | lr_mult: 0.0 1852 | decay_mult: 0.0 1853 | } 1854 | param { 1855 | lr_mult: 0.0 1856 | decay_mult: 0.0 1857 | } 1858 | param { 1859 | lr_mult: 0.0 1860 | decay_mult: 0.0 1861 | } 1862 | } 1863 | layer { 1864 | name: "stage_3_3/conv1/bn/scale" 1865 | type: "Scale" 1866 | bottom: "stage_3_3/conv1" 1867 | top: "stage_3_3/conv1" 1868 | param { 1869 | lr_mult: 1.0 1870 | decay_mult: 0.0 1871 | } 1872 | param { 1873 | lr_mult: 1.0 1874 | decay_mult: 0.0 1875 | } 1876 | scale_param { 1877 | filler { 1878 | type: "constant" 1879 | value: 1.0 1880 | } 1881 | bias_term: true 1882 | bias_filler { 1883 | type: "constant" 1884 | value: 0.0 1885 | } 1886 | } 1887 | } 1888 | layer { 1889 | name: "stage_3_3/conv1/relu" 1890 | type: "ReLU" 1891 | bottom: "stage_3_3/conv1" 1892 | top: "stage_3_3/conv1" 1893 | } 1894 | layer { 1895 | name: "stage_3_3/conv2" 1896 | type: "Convolution" 1897 | bottom: "stage_3_3/conv1" 1898 | top: "stage_3_3/conv2" 1899 | param { 1900 | lr_mult: 1.0 1901 | decay_mult: 1.0 1902 | } 1903 | convolution_param { 1904 | num_output: 116 1905 | bias_term: false 1906 | pad: 1 1907 | kernel_size: 3 1908 | group: 116 1909 | stride: 1 1910 | weight_filler { 1911 | type: "msra" 1912 | } 1913 | dilation: 1 1914 | } 1915 | } 1916 | layer { 1917 | name: "stage_3_3/conv2/bn" 1918 | type: "BatchNorm" 1919 | bottom: "stage_3_3/conv2" 1920 | top: "stage_3_3/conv2" 1921 | param { 1922 | lr_mult: 0.0 1923 | decay_mult: 0.0 1924 | } 1925 | param { 1926 | lr_mult: 0.0 1927 | decay_mult: 0.0 1928 | } 1929 | param { 1930 | lr_mult: 0.0 1931 | decay_mult: 0.0 1932 | } 1933 | } 1934 | layer { 1935 | name: "stage_3_3/conv2/bn/scale" 1936 | type: "Scale" 1937 | bottom: "stage_3_3/conv2" 1938 | top: "stage_3_3/conv2" 1939 | param { 1940 | lr_mult: 1.0 1941 | decay_mult: 0.0 1942 | } 1943 | param { 1944 | lr_mult: 1.0 1945 | decay_mult: 0.0 1946 | } 1947 | scale_param { 1948 | filler { 1949 | type: "constant" 1950 | value: 1.0 1951 | } 1952 | bias_term: true 1953 | bias_filler { 1954 | type: "constant" 1955 | value: 0.0 1956 | } 1957 | } 1958 | } 1959 | layer { 1960 | name: "stage_3_3/conv3" 1961 | type: "Convolution" 1962 | bottom: "stage_3_3/conv2" 1963 | top: "stage_3_3/conv3" 1964 | param { 1965 | lr_mult: 1.0 1966 | decay_mult: 1.0 1967 | } 1968 | convolution_param { 1969 | num_output: 116 1970 | bias_term: false 1971 | pad: 0 1972 | kernel_size: 1 1973 | group: 1 1974 | stride: 1 1975 | weight_filler { 1976 | type: "msra" 1977 | } 1978 | dilation: 1 1979 | } 1980 | } 1981 | layer { 1982 | name: "stage_3_3/conv3/bn" 1983 | type: "BatchNorm" 1984 | bottom: "stage_3_3/conv3" 1985 | top: "stage_3_3/conv3" 1986 | param { 1987 | lr_mult: 0.0 1988 | decay_mult: 0.0 1989 | } 1990 | param { 1991 | lr_mult: 0.0 1992 | decay_mult: 0.0 1993 | } 1994 | param { 1995 | lr_mult: 0.0 1996 | decay_mult: 0.0 1997 | } 1998 | } 1999 | layer { 2000 | name: "stage_3_3/conv3/bn/scale" 2001 | type: "Scale" 2002 | bottom: "stage_3_3/conv3" 2003 | top: "stage_3_3/conv3" 2004 | param { 2005 | lr_mult: 1.0 2006 | decay_mult: 0.0 2007 | } 2008 | param { 2009 | lr_mult: 1.0 2010 | decay_mult: 0.0 2011 | } 2012 | scale_param { 2013 | filler { 2014 | type: "constant" 2015 | value: 1.0 2016 | } 2017 | bias_term: true 2018 | bias_filler { 2019 | type: "constant" 2020 | value: 0.0 2021 | } 2022 | } 2023 | } 2024 | layer { 2025 | name: "stage_3_3/conv3/relu" 2026 | type: "ReLU" 2027 | bottom: "stage_3_3/conv3" 2028 | top: "stage_3_3/conv3" 2029 | } 2030 | layer { 2031 | name: "stage_3_3/concat" 2032 | type: "Concat" 2033 | bottom: "stage_3_3/slice1" 2034 | bottom: "stage_3_3/conv3" 2035 | top: "stage_3_3/concat" 2036 | concat_param { 2037 | axis: 1 2038 | } 2039 | } 2040 | layer { 2041 | name: "stage_3_3/shuffle" 2042 | type: "ShuffleChannel" 2043 | bottom: "stage_3_3/concat" 2044 | top: "stage_3_3/shuffle" 2045 | shuffle_channel_param { 2046 | group: 2 2047 | } 2048 | } 2049 | layer { 2050 | name: "stage_3_4/slice1" 2051 | type: "Slice" 2052 | bottom: "stage_3_3/shuffle" 2053 | top: "stage_3_4/slice1" 2054 | top: "stage_3_4/slice2" 2055 | slice_param { 2056 | slice_point: 116 2057 | axis: 1 2058 | } 2059 | } 2060 | layer { 2061 | name: "stage_3_4/conv1" 2062 | type: "Convolution" 2063 | bottom: "stage_3_4/slice2" 2064 | top: "stage_3_4/conv1" 2065 | param { 2066 | lr_mult: 1.0 2067 | decay_mult: 1.0 2068 | } 2069 | convolution_param { 2070 | num_output: 116 2071 | bias_term: false 2072 | pad: 0 2073 | kernel_size: 1 2074 | group: 1 2075 | stride: 1 2076 | weight_filler { 2077 | type: "msra" 2078 | } 2079 | dilation: 1 2080 | } 2081 | } 2082 | layer { 2083 | name: "stage_3_4/conv1/bn" 2084 | type: "BatchNorm" 2085 | bottom: "stage_3_4/conv1" 2086 | top: "stage_3_4/conv1" 2087 | param { 2088 | lr_mult: 0.0 2089 | decay_mult: 0.0 2090 | } 2091 | param { 2092 | lr_mult: 0.0 2093 | decay_mult: 0.0 2094 | } 2095 | param { 2096 | lr_mult: 0.0 2097 | decay_mult: 0.0 2098 | } 2099 | } 2100 | layer { 2101 | name: "stage_3_4/conv1/bn/scale" 2102 | type: "Scale" 2103 | bottom: "stage_3_4/conv1" 2104 | top: "stage_3_4/conv1" 2105 | param { 2106 | lr_mult: 1.0 2107 | decay_mult: 0.0 2108 | } 2109 | param { 2110 | lr_mult: 1.0 2111 | decay_mult: 0.0 2112 | } 2113 | scale_param { 2114 | filler { 2115 | type: "constant" 2116 | value: 1.0 2117 | } 2118 | bias_term: true 2119 | bias_filler { 2120 | type: "constant" 2121 | value: 0.0 2122 | } 2123 | } 2124 | } 2125 | layer { 2126 | name: "stage_3_4/conv1/relu" 2127 | type: "ReLU" 2128 | bottom: "stage_3_4/conv1" 2129 | top: "stage_3_4/conv1" 2130 | } 2131 | layer { 2132 | name: "stage_3_4/conv2" 2133 | type: "Convolution" 2134 | bottom: "stage_3_4/conv1" 2135 | top: "stage_3_4/conv2" 2136 | param { 2137 | lr_mult: 1.0 2138 | decay_mult: 1.0 2139 | } 2140 | convolution_param { 2141 | num_output: 116 2142 | bias_term: false 2143 | pad: 1 2144 | kernel_size: 3 2145 | group: 116 2146 | stride: 1 2147 | weight_filler { 2148 | type: "msra" 2149 | } 2150 | dilation: 1 2151 | } 2152 | } 2153 | layer { 2154 | name: "stage_3_4/conv2/bn" 2155 | type: "BatchNorm" 2156 | bottom: "stage_3_4/conv2" 2157 | top: "stage_3_4/conv2" 2158 | param { 2159 | lr_mult: 0.0 2160 | decay_mult: 0.0 2161 | } 2162 | param { 2163 | lr_mult: 0.0 2164 | decay_mult: 0.0 2165 | } 2166 | param { 2167 | lr_mult: 0.0 2168 | decay_mult: 0.0 2169 | } 2170 | } 2171 | layer { 2172 | name: "stage_3_4/conv2/bn/scale" 2173 | type: "Scale" 2174 | bottom: "stage_3_4/conv2" 2175 | top: "stage_3_4/conv2" 2176 | param { 2177 | lr_mult: 1.0 2178 | decay_mult: 0.0 2179 | } 2180 | param { 2181 | lr_mult: 1.0 2182 | decay_mult: 0.0 2183 | } 2184 | scale_param { 2185 | filler { 2186 | type: "constant" 2187 | value: 1.0 2188 | } 2189 | bias_term: true 2190 | bias_filler { 2191 | type: "constant" 2192 | value: 0.0 2193 | } 2194 | } 2195 | } 2196 | layer { 2197 | name: "stage_3_4/conv3" 2198 | type: "Convolution" 2199 | bottom: "stage_3_4/conv2" 2200 | top: "stage_3_4/conv3" 2201 | param { 2202 | lr_mult: 1.0 2203 | decay_mult: 1.0 2204 | } 2205 | convolution_param { 2206 | num_output: 116 2207 | bias_term: false 2208 | pad: 0 2209 | kernel_size: 1 2210 | group: 1 2211 | stride: 1 2212 | weight_filler { 2213 | type: "msra" 2214 | } 2215 | dilation: 1 2216 | } 2217 | } 2218 | layer { 2219 | name: "stage_3_4/conv3/bn" 2220 | type: "BatchNorm" 2221 | bottom: "stage_3_4/conv3" 2222 | top: "stage_3_4/conv3" 2223 | param { 2224 | lr_mult: 0.0 2225 | decay_mult: 0.0 2226 | } 2227 | param { 2228 | lr_mult: 0.0 2229 | decay_mult: 0.0 2230 | } 2231 | param { 2232 | lr_mult: 0.0 2233 | decay_mult: 0.0 2234 | } 2235 | } 2236 | layer { 2237 | name: "stage_3_4/conv3/bn/scale" 2238 | type: "Scale" 2239 | bottom: "stage_3_4/conv3" 2240 | top: "stage_3_4/conv3" 2241 | param { 2242 | lr_mult: 1.0 2243 | decay_mult: 0.0 2244 | } 2245 | param { 2246 | lr_mult: 1.0 2247 | decay_mult: 0.0 2248 | } 2249 | scale_param { 2250 | filler { 2251 | type: "constant" 2252 | value: 1.0 2253 | } 2254 | bias_term: true 2255 | bias_filler { 2256 | type: "constant" 2257 | value: 0.0 2258 | } 2259 | } 2260 | } 2261 | layer { 2262 | name: "stage_3_4/conv3/relu" 2263 | type: "ReLU" 2264 | bottom: "stage_3_4/conv3" 2265 | top: "stage_3_4/conv3" 2266 | } 2267 | layer { 2268 | name: "stage_3_4/concat" 2269 | type: "Concat" 2270 | bottom: "stage_3_4/slice1" 2271 | bottom: "stage_3_4/conv3" 2272 | top: "stage_3_4/concat" 2273 | concat_param { 2274 | axis: 1 2275 | } 2276 | } 2277 | layer { 2278 | name: "stage_3_4/shuffle" 2279 | type: "ShuffleChannel" 2280 | bottom: "stage_3_4/concat" 2281 | top: "stage_3_4/shuffle" 2282 | shuffle_channel_param { 2283 | group: 2 2284 | } 2285 | } 2286 | layer { 2287 | name: "stage_3_5/slice1" 2288 | type: "Slice" 2289 | bottom: "stage_3_4/shuffle" 2290 | top: "stage_3_5/slice1" 2291 | top: "stage_3_5/slice2" 2292 | slice_param { 2293 | slice_point: 116 2294 | axis: 1 2295 | } 2296 | } 2297 | layer { 2298 | name: "stage_3_5/conv1" 2299 | type: "Convolution" 2300 | bottom: "stage_3_5/slice2" 2301 | top: "stage_3_5/conv1" 2302 | param { 2303 | lr_mult: 1.0 2304 | decay_mult: 1.0 2305 | } 2306 | convolution_param { 2307 | num_output: 116 2308 | bias_term: false 2309 | pad: 0 2310 | kernel_size: 1 2311 | group: 1 2312 | stride: 1 2313 | weight_filler { 2314 | type: "msra" 2315 | } 2316 | dilation: 1 2317 | } 2318 | } 2319 | layer { 2320 | name: "stage_3_5/conv1/bn" 2321 | type: "BatchNorm" 2322 | bottom: "stage_3_5/conv1" 2323 | top: "stage_3_5/conv1" 2324 | param { 2325 | lr_mult: 0.0 2326 | decay_mult: 0.0 2327 | } 2328 | param { 2329 | lr_mult: 0.0 2330 | decay_mult: 0.0 2331 | } 2332 | param { 2333 | lr_mult: 0.0 2334 | decay_mult: 0.0 2335 | } 2336 | } 2337 | layer { 2338 | name: "stage_3_5/conv1/bn/scale" 2339 | type: "Scale" 2340 | bottom: "stage_3_5/conv1" 2341 | top: "stage_3_5/conv1" 2342 | param { 2343 | lr_mult: 1.0 2344 | decay_mult: 0.0 2345 | } 2346 | param { 2347 | lr_mult: 1.0 2348 | decay_mult: 0.0 2349 | } 2350 | scale_param { 2351 | filler { 2352 | type: "constant" 2353 | value: 1.0 2354 | } 2355 | bias_term: true 2356 | bias_filler { 2357 | type: "constant" 2358 | value: 0.0 2359 | } 2360 | } 2361 | } 2362 | layer { 2363 | name: "stage_3_5/conv1/relu" 2364 | type: "ReLU" 2365 | bottom: "stage_3_5/conv1" 2366 | top: "stage_3_5/conv1" 2367 | } 2368 | layer { 2369 | name: "stage_3_5/conv2" 2370 | type: "Convolution" 2371 | bottom: "stage_3_5/conv1" 2372 | top: "stage_3_5/conv2" 2373 | param { 2374 | lr_mult: 1.0 2375 | decay_mult: 1.0 2376 | } 2377 | convolution_param { 2378 | num_output: 116 2379 | bias_term: false 2380 | pad: 1 2381 | kernel_size: 3 2382 | group: 116 2383 | stride: 1 2384 | weight_filler { 2385 | type: "msra" 2386 | } 2387 | dilation: 1 2388 | } 2389 | } 2390 | layer { 2391 | name: "stage_3_5/conv2/bn" 2392 | type: "BatchNorm" 2393 | bottom: "stage_3_5/conv2" 2394 | top: "stage_3_5/conv2" 2395 | param { 2396 | lr_mult: 0.0 2397 | decay_mult: 0.0 2398 | } 2399 | param { 2400 | lr_mult: 0.0 2401 | decay_mult: 0.0 2402 | } 2403 | param { 2404 | lr_mult: 0.0 2405 | decay_mult: 0.0 2406 | } 2407 | } 2408 | layer { 2409 | name: "stage_3_5/conv2/bn/scale" 2410 | type: "Scale" 2411 | bottom: "stage_3_5/conv2" 2412 | top: "stage_3_5/conv2" 2413 | param { 2414 | lr_mult: 1.0 2415 | decay_mult: 0.0 2416 | } 2417 | param { 2418 | lr_mult: 1.0 2419 | decay_mult: 0.0 2420 | } 2421 | scale_param { 2422 | filler { 2423 | type: "constant" 2424 | value: 1.0 2425 | } 2426 | bias_term: true 2427 | bias_filler { 2428 | type: "constant" 2429 | value: 0.0 2430 | } 2431 | } 2432 | } 2433 | layer { 2434 | name: "stage_3_5/conv3" 2435 | type: "Convolution" 2436 | bottom: "stage_3_5/conv2" 2437 | top: "stage_3_5/conv3" 2438 | param { 2439 | lr_mult: 1.0 2440 | decay_mult: 1.0 2441 | } 2442 | convolution_param { 2443 | num_output: 116 2444 | bias_term: false 2445 | pad: 0 2446 | kernel_size: 1 2447 | group: 1 2448 | stride: 1 2449 | weight_filler { 2450 | type: "msra" 2451 | } 2452 | dilation: 1 2453 | } 2454 | } 2455 | layer { 2456 | name: "stage_3_5/conv3/bn" 2457 | type: "BatchNorm" 2458 | bottom: "stage_3_5/conv3" 2459 | top: "stage_3_5/conv3" 2460 | param { 2461 | lr_mult: 0.0 2462 | decay_mult: 0.0 2463 | } 2464 | param { 2465 | lr_mult: 0.0 2466 | decay_mult: 0.0 2467 | } 2468 | param { 2469 | lr_mult: 0.0 2470 | decay_mult: 0.0 2471 | } 2472 | } 2473 | layer { 2474 | name: "stage_3_5/conv3/bn/scale" 2475 | type: "Scale" 2476 | bottom: "stage_3_5/conv3" 2477 | top: "stage_3_5/conv3" 2478 | param { 2479 | lr_mult: 1.0 2480 | decay_mult: 0.0 2481 | } 2482 | param { 2483 | lr_mult: 1.0 2484 | decay_mult: 0.0 2485 | } 2486 | scale_param { 2487 | filler { 2488 | type: "constant" 2489 | value: 1.0 2490 | } 2491 | bias_term: true 2492 | bias_filler { 2493 | type: "constant" 2494 | value: 0.0 2495 | } 2496 | } 2497 | } 2498 | layer { 2499 | name: "stage_3_5/conv3/relu" 2500 | type: "ReLU" 2501 | bottom: "stage_3_5/conv3" 2502 | top: "stage_3_5/conv3" 2503 | } 2504 | layer { 2505 | name: "stage_3_5/concat" 2506 | type: "Concat" 2507 | bottom: "stage_3_5/slice1" 2508 | bottom: "stage_3_5/conv3" 2509 | top: "stage_3_5/concat" 2510 | concat_param { 2511 | axis: 1 2512 | } 2513 | } 2514 | layer { 2515 | name: "stage_3_5/shuffle" 2516 | type: "ShuffleChannel" 2517 | bottom: "stage_3_5/concat" 2518 | top: "stage_3_5/shuffle" 2519 | shuffle_channel_param { 2520 | group: 2 2521 | } 2522 | } 2523 | layer { 2524 | name: "stage_3_6/slice1" 2525 | type: "Slice" 2526 | bottom: "stage_3_5/shuffle" 2527 | top: "stage_3_6/slice1" 2528 | top: "stage_3_6/slice2" 2529 | slice_param { 2530 | slice_point: 116 2531 | axis: 1 2532 | } 2533 | } 2534 | layer { 2535 | name: "stage_3_6/conv1" 2536 | type: "Convolution" 2537 | bottom: "stage_3_6/slice2" 2538 | top: "stage_3_6/conv1" 2539 | param { 2540 | lr_mult: 1.0 2541 | decay_mult: 1.0 2542 | } 2543 | convolution_param { 2544 | num_output: 116 2545 | bias_term: false 2546 | pad: 0 2547 | kernel_size: 1 2548 | group: 1 2549 | stride: 1 2550 | weight_filler { 2551 | type: "msra" 2552 | } 2553 | dilation: 1 2554 | } 2555 | } 2556 | layer { 2557 | name: "stage_3_6/conv1/bn" 2558 | type: "BatchNorm" 2559 | bottom: "stage_3_6/conv1" 2560 | top: "stage_3_6/conv1" 2561 | param { 2562 | lr_mult: 0.0 2563 | decay_mult: 0.0 2564 | } 2565 | param { 2566 | lr_mult: 0.0 2567 | decay_mult: 0.0 2568 | } 2569 | param { 2570 | lr_mult: 0.0 2571 | decay_mult: 0.0 2572 | } 2573 | } 2574 | layer { 2575 | name: "stage_3_6/conv1/bn/scale" 2576 | type: "Scale" 2577 | bottom: "stage_3_6/conv1" 2578 | top: "stage_3_6/conv1" 2579 | param { 2580 | lr_mult: 1.0 2581 | decay_mult: 0.0 2582 | } 2583 | param { 2584 | lr_mult: 1.0 2585 | decay_mult: 0.0 2586 | } 2587 | scale_param { 2588 | filler { 2589 | type: "constant" 2590 | value: 1.0 2591 | } 2592 | bias_term: true 2593 | bias_filler { 2594 | type: "constant" 2595 | value: 0.0 2596 | } 2597 | } 2598 | } 2599 | layer { 2600 | name: "stage_3_6/conv1/relu" 2601 | type: "ReLU" 2602 | bottom: "stage_3_6/conv1" 2603 | top: "stage_3_6/conv1" 2604 | } 2605 | layer { 2606 | name: "stage_3_6/conv2" 2607 | type: "Convolution" 2608 | bottom: "stage_3_6/conv1" 2609 | top: "stage_3_6/conv2" 2610 | param { 2611 | lr_mult: 1.0 2612 | decay_mult: 1.0 2613 | } 2614 | convolution_param { 2615 | num_output: 116 2616 | bias_term: false 2617 | pad: 1 2618 | kernel_size: 3 2619 | group: 116 2620 | stride: 1 2621 | weight_filler { 2622 | type: "msra" 2623 | } 2624 | dilation: 1 2625 | } 2626 | } 2627 | layer { 2628 | name: "stage_3_6/conv2/bn" 2629 | type: "BatchNorm" 2630 | bottom: "stage_3_6/conv2" 2631 | top: "stage_3_6/conv2" 2632 | param { 2633 | lr_mult: 0.0 2634 | decay_mult: 0.0 2635 | } 2636 | param { 2637 | lr_mult: 0.0 2638 | decay_mult: 0.0 2639 | } 2640 | param { 2641 | lr_mult: 0.0 2642 | decay_mult: 0.0 2643 | } 2644 | } 2645 | layer { 2646 | name: "stage_3_6/conv2/bn/scale" 2647 | type: "Scale" 2648 | bottom: "stage_3_6/conv2" 2649 | top: "stage_3_6/conv2" 2650 | param { 2651 | lr_mult: 1.0 2652 | decay_mult: 0.0 2653 | } 2654 | param { 2655 | lr_mult: 1.0 2656 | decay_mult: 0.0 2657 | } 2658 | scale_param { 2659 | filler { 2660 | type: "constant" 2661 | value: 1.0 2662 | } 2663 | bias_term: true 2664 | bias_filler { 2665 | type: "constant" 2666 | value: 0.0 2667 | } 2668 | } 2669 | } 2670 | layer { 2671 | name: "stage_3_6/conv3" 2672 | type: "Convolution" 2673 | bottom: "stage_3_6/conv2" 2674 | top: "stage_3_6/conv3" 2675 | param { 2676 | lr_mult: 1.0 2677 | decay_mult: 1.0 2678 | } 2679 | convolution_param { 2680 | num_output: 116 2681 | bias_term: false 2682 | pad: 0 2683 | kernel_size: 1 2684 | group: 1 2685 | stride: 1 2686 | weight_filler { 2687 | type: "msra" 2688 | } 2689 | dilation: 1 2690 | } 2691 | } 2692 | layer { 2693 | name: "stage_3_6/conv3/bn" 2694 | type: "BatchNorm" 2695 | bottom: "stage_3_6/conv3" 2696 | top: "stage_3_6/conv3" 2697 | param { 2698 | lr_mult: 0.0 2699 | decay_mult: 0.0 2700 | } 2701 | param { 2702 | lr_mult: 0.0 2703 | decay_mult: 0.0 2704 | } 2705 | param { 2706 | lr_mult: 0.0 2707 | decay_mult: 0.0 2708 | } 2709 | } 2710 | layer { 2711 | name: "stage_3_6/conv3/bn/scale" 2712 | type: "Scale" 2713 | bottom: "stage_3_6/conv3" 2714 | top: "stage_3_6/conv3" 2715 | param { 2716 | lr_mult: 1.0 2717 | decay_mult: 0.0 2718 | } 2719 | param { 2720 | lr_mult: 1.0 2721 | decay_mult: 0.0 2722 | } 2723 | scale_param { 2724 | filler { 2725 | type: "constant" 2726 | value: 1.0 2727 | } 2728 | bias_term: true 2729 | bias_filler { 2730 | type: "constant" 2731 | value: 0.0 2732 | } 2733 | } 2734 | } 2735 | layer { 2736 | name: "stage_3_6/conv3/relu" 2737 | type: "ReLU" 2738 | bottom: "stage_3_6/conv3" 2739 | top: "stage_3_6/conv3" 2740 | } 2741 | layer { 2742 | name: "stage_3_6/concat" 2743 | type: "Concat" 2744 | bottom: "stage_3_6/slice1" 2745 | bottom: "stage_3_6/conv3" 2746 | top: "stage_3_6/concat" 2747 | concat_param { 2748 | axis: 1 2749 | } 2750 | } 2751 | layer { 2752 | name: "stage_3_6/shuffle" 2753 | type: "ShuffleChannel" 2754 | bottom: "stage_3_6/concat" 2755 | top: "stage_3_6/shuffle" 2756 | shuffle_channel_param { 2757 | group: 2 2758 | } 2759 | } 2760 | layer { 2761 | name: "stage_3_7/slice1" 2762 | type: "Slice" 2763 | bottom: "stage_3_6/shuffle" 2764 | top: "stage_3_7/slice1" 2765 | top: "stage_3_7/slice2" 2766 | slice_param { 2767 | slice_point: 116 2768 | axis: 1 2769 | } 2770 | } 2771 | layer { 2772 | name: "stage_3_7/conv1" 2773 | type: "Convolution" 2774 | bottom: "stage_3_7/slice2" 2775 | top: "stage_3_7/conv1" 2776 | param { 2777 | lr_mult: 1.0 2778 | decay_mult: 1.0 2779 | } 2780 | convolution_param { 2781 | num_output: 116 2782 | bias_term: false 2783 | pad: 0 2784 | kernel_size: 1 2785 | group: 1 2786 | stride: 1 2787 | weight_filler { 2788 | type: "msra" 2789 | } 2790 | dilation: 1 2791 | } 2792 | } 2793 | layer { 2794 | name: "stage_3_7/conv1/bn" 2795 | type: "BatchNorm" 2796 | bottom: "stage_3_7/conv1" 2797 | top: "stage_3_7/conv1" 2798 | param { 2799 | lr_mult: 0.0 2800 | decay_mult: 0.0 2801 | } 2802 | param { 2803 | lr_mult: 0.0 2804 | decay_mult: 0.0 2805 | } 2806 | param { 2807 | lr_mult: 0.0 2808 | decay_mult: 0.0 2809 | } 2810 | } 2811 | layer { 2812 | name: "stage_3_7/conv1/bn/scale" 2813 | type: "Scale" 2814 | bottom: "stage_3_7/conv1" 2815 | top: "stage_3_7/conv1" 2816 | param { 2817 | lr_mult: 1.0 2818 | decay_mult: 0.0 2819 | } 2820 | param { 2821 | lr_mult: 1.0 2822 | decay_mult: 0.0 2823 | } 2824 | scale_param { 2825 | filler { 2826 | type: "constant" 2827 | value: 1.0 2828 | } 2829 | bias_term: true 2830 | bias_filler { 2831 | type: "constant" 2832 | value: 0.0 2833 | } 2834 | } 2835 | } 2836 | layer { 2837 | name: "stage_3_7/conv1/relu" 2838 | type: "ReLU" 2839 | bottom: "stage_3_7/conv1" 2840 | top: "stage_3_7/conv1" 2841 | } 2842 | layer { 2843 | name: "stage_3_7/conv2" 2844 | type: "Convolution" 2845 | bottom: "stage_3_7/conv1" 2846 | top: "stage_3_7/conv2" 2847 | param { 2848 | lr_mult: 1.0 2849 | decay_mult: 1.0 2850 | } 2851 | convolution_param { 2852 | num_output: 116 2853 | bias_term: false 2854 | pad: 1 2855 | kernel_size: 3 2856 | group: 116 2857 | stride: 1 2858 | weight_filler { 2859 | type: "msra" 2860 | } 2861 | dilation: 1 2862 | } 2863 | } 2864 | layer { 2865 | name: "stage_3_7/conv2/bn" 2866 | type: "BatchNorm" 2867 | bottom: "stage_3_7/conv2" 2868 | top: "stage_3_7/conv2" 2869 | param { 2870 | lr_mult: 0.0 2871 | decay_mult: 0.0 2872 | } 2873 | param { 2874 | lr_mult: 0.0 2875 | decay_mult: 0.0 2876 | } 2877 | param { 2878 | lr_mult: 0.0 2879 | decay_mult: 0.0 2880 | } 2881 | } 2882 | layer { 2883 | name: "stage_3_7/conv2/bn/scale" 2884 | type: "Scale" 2885 | bottom: "stage_3_7/conv2" 2886 | top: "stage_3_7/conv2" 2887 | param { 2888 | lr_mult: 1.0 2889 | decay_mult: 0.0 2890 | } 2891 | param { 2892 | lr_mult: 1.0 2893 | decay_mult: 0.0 2894 | } 2895 | scale_param { 2896 | filler { 2897 | type: "constant" 2898 | value: 1.0 2899 | } 2900 | bias_term: true 2901 | bias_filler { 2902 | type: "constant" 2903 | value: 0.0 2904 | } 2905 | } 2906 | } 2907 | layer { 2908 | name: "stage_3_7/conv3" 2909 | type: "Convolution" 2910 | bottom: "stage_3_7/conv2" 2911 | top: "stage_3_7/conv3" 2912 | param { 2913 | lr_mult: 1.0 2914 | decay_mult: 1.0 2915 | } 2916 | convolution_param { 2917 | num_output: 116 2918 | bias_term: false 2919 | pad: 0 2920 | kernel_size: 1 2921 | group: 1 2922 | stride: 1 2923 | weight_filler { 2924 | type: "msra" 2925 | } 2926 | dilation: 1 2927 | } 2928 | } 2929 | layer { 2930 | name: "stage_3_7/conv3/bn" 2931 | type: "BatchNorm" 2932 | bottom: "stage_3_7/conv3" 2933 | top: "stage_3_7/conv3" 2934 | param { 2935 | lr_mult: 0.0 2936 | decay_mult: 0.0 2937 | } 2938 | param { 2939 | lr_mult: 0.0 2940 | decay_mult: 0.0 2941 | } 2942 | param { 2943 | lr_mult: 0.0 2944 | decay_mult: 0.0 2945 | } 2946 | } 2947 | layer { 2948 | name: "stage_3_7/conv3/bn/scale" 2949 | type: "Scale" 2950 | bottom: "stage_3_7/conv3" 2951 | top: "stage_3_7/conv3" 2952 | param { 2953 | lr_mult: 1.0 2954 | decay_mult: 0.0 2955 | } 2956 | param { 2957 | lr_mult: 1.0 2958 | decay_mult: 0.0 2959 | } 2960 | scale_param { 2961 | filler { 2962 | type: "constant" 2963 | value: 1.0 2964 | } 2965 | bias_term: true 2966 | bias_filler { 2967 | type: "constant" 2968 | value: 0.0 2969 | } 2970 | } 2971 | } 2972 | layer { 2973 | name: "stage_3_7/conv3/relu" 2974 | type: "ReLU" 2975 | bottom: "stage_3_7/conv3" 2976 | top: "stage_3_7/conv3" 2977 | } 2978 | layer { 2979 | name: "stage_3_7/concat" 2980 | type: "Concat" 2981 | bottom: "stage_3_7/slice1" 2982 | bottom: "stage_3_7/conv3" 2983 | top: "stage_3_7/concat" 2984 | concat_param { 2985 | axis: 1 2986 | } 2987 | } 2988 | layer { 2989 | name: "stage_3_7/shuffle" 2990 | type: "ShuffleChannel" 2991 | bottom: "stage_3_7/concat" 2992 | top: "stage_3_7/shuffle" 2993 | shuffle_channel_param { 2994 | group: 2 2995 | } 2996 | } 2997 | layer { 2998 | name: "stage_3_8/slice1" 2999 | type: "Slice" 3000 | bottom: "stage_3_7/shuffle" 3001 | top: "stage_3_8/slice1" 3002 | top: "stage_3_8/slice2" 3003 | slice_param { 3004 | slice_point: 116 3005 | axis: 1 3006 | } 3007 | } 3008 | layer { 3009 | name: "stage_3_8/conv1" 3010 | type: "Convolution" 3011 | bottom: "stage_3_8/slice2" 3012 | top: "stage_3_8/conv1" 3013 | param { 3014 | lr_mult: 1.0 3015 | decay_mult: 1.0 3016 | } 3017 | convolution_param { 3018 | num_output: 116 3019 | bias_term: false 3020 | pad: 0 3021 | kernel_size: 1 3022 | group: 1 3023 | stride: 1 3024 | weight_filler { 3025 | type: "msra" 3026 | } 3027 | dilation: 1 3028 | } 3029 | } 3030 | layer { 3031 | name: "stage_3_8/conv1/bn" 3032 | type: "BatchNorm" 3033 | bottom: "stage_3_8/conv1" 3034 | top: "stage_3_8/conv1" 3035 | param { 3036 | lr_mult: 0.0 3037 | decay_mult: 0.0 3038 | } 3039 | param { 3040 | lr_mult: 0.0 3041 | decay_mult: 0.0 3042 | } 3043 | param { 3044 | lr_mult: 0.0 3045 | decay_mult: 0.0 3046 | } 3047 | } 3048 | layer { 3049 | name: "stage_3_8/conv1/bn/scale" 3050 | type: "Scale" 3051 | bottom: "stage_3_8/conv1" 3052 | top: "stage_3_8/conv1" 3053 | param { 3054 | lr_mult: 1.0 3055 | decay_mult: 0.0 3056 | } 3057 | param { 3058 | lr_mult: 1.0 3059 | decay_mult: 0.0 3060 | } 3061 | scale_param { 3062 | filler { 3063 | type: "constant" 3064 | value: 1.0 3065 | } 3066 | bias_term: true 3067 | bias_filler { 3068 | type: "constant" 3069 | value: 0.0 3070 | } 3071 | } 3072 | } 3073 | layer { 3074 | name: "stage_3_8/conv1/relu" 3075 | type: "ReLU" 3076 | bottom: "stage_3_8/conv1" 3077 | top: "stage_3_8/conv1" 3078 | } 3079 | layer { 3080 | name: "stage_3_8/conv2" 3081 | type: "Convolution" 3082 | bottom: "stage_3_8/conv1" 3083 | top: "stage_3_8/conv2" 3084 | param { 3085 | lr_mult: 1.0 3086 | decay_mult: 1.0 3087 | } 3088 | convolution_param { 3089 | num_output: 116 3090 | bias_term: false 3091 | pad: 1 3092 | kernel_size: 3 3093 | group: 116 3094 | stride: 1 3095 | weight_filler { 3096 | type: "msra" 3097 | } 3098 | dilation: 1 3099 | } 3100 | } 3101 | layer { 3102 | name: "stage_3_8/conv2/bn" 3103 | type: "BatchNorm" 3104 | bottom: "stage_3_8/conv2" 3105 | top: "stage_3_8/conv2" 3106 | param { 3107 | lr_mult: 0.0 3108 | decay_mult: 0.0 3109 | } 3110 | param { 3111 | lr_mult: 0.0 3112 | decay_mult: 0.0 3113 | } 3114 | param { 3115 | lr_mult: 0.0 3116 | decay_mult: 0.0 3117 | } 3118 | } 3119 | layer { 3120 | name: "stage_3_8/conv2/bn/scale" 3121 | type: "Scale" 3122 | bottom: "stage_3_8/conv2" 3123 | top: "stage_3_8/conv2" 3124 | param { 3125 | lr_mult: 1.0 3126 | decay_mult: 0.0 3127 | } 3128 | param { 3129 | lr_mult: 1.0 3130 | decay_mult: 0.0 3131 | } 3132 | scale_param { 3133 | filler { 3134 | type: "constant" 3135 | value: 1.0 3136 | } 3137 | bias_term: true 3138 | bias_filler { 3139 | type: "constant" 3140 | value: 0.0 3141 | } 3142 | } 3143 | } 3144 | layer { 3145 | name: "stage_3_8/conv3" 3146 | type: "Convolution" 3147 | bottom: "stage_3_8/conv2" 3148 | top: "stage_3_8/conv3" 3149 | param { 3150 | lr_mult: 1.0 3151 | decay_mult: 1.0 3152 | } 3153 | convolution_param { 3154 | num_output: 116 3155 | bias_term: false 3156 | pad: 0 3157 | kernel_size: 1 3158 | group: 1 3159 | stride: 1 3160 | weight_filler { 3161 | type: "msra" 3162 | } 3163 | dilation: 1 3164 | } 3165 | } 3166 | layer { 3167 | name: "stage_3_8/conv3/bn" 3168 | type: "BatchNorm" 3169 | bottom: "stage_3_8/conv3" 3170 | top: "stage_3_8/conv3" 3171 | param { 3172 | lr_mult: 0.0 3173 | decay_mult: 0.0 3174 | } 3175 | param { 3176 | lr_mult: 0.0 3177 | decay_mult: 0.0 3178 | } 3179 | param { 3180 | lr_mult: 0.0 3181 | decay_mult: 0.0 3182 | } 3183 | } 3184 | layer { 3185 | name: "stage_3_8/conv3/bn/scale" 3186 | type: "Scale" 3187 | bottom: "stage_3_8/conv3" 3188 | top: "stage_3_8/conv3" 3189 | param { 3190 | lr_mult: 1.0 3191 | decay_mult: 0.0 3192 | } 3193 | param { 3194 | lr_mult: 1.0 3195 | decay_mult: 0.0 3196 | } 3197 | scale_param { 3198 | filler { 3199 | type: "constant" 3200 | value: 1.0 3201 | } 3202 | bias_term: true 3203 | bias_filler { 3204 | type: "constant" 3205 | value: 0.0 3206 | } 3207 | } 3208 | } 3209 | layer { 3210 | name: "stage_3_8/conv3/relu" 3211 | type: "ReLU" 3212 | bottom: "stage_3_8/conv3" 3213 | top: "stage_3_8/conv3" 3214 | } 3215 | layer { 3216 | name: "stage_3_8/concat" 3217 | type: "Concat" 3218 | bottom: "stage_3_8/slice1" 3219 | bottom: "stage_3_8/conv3" 3220 | top: "stage_3_8/concat" 3221 | concat_param { 3222 | axis: 1 3223 | } 3224 | } 3225 | layer { 3226 | name: "stage_3_8/shuffle" 3227 | type: "ShuffleChannel" 3228 | bottom: "stage_3_8/concat" 3229 | top: "stage_3_8/shuffle" 3230 | shuffle_channel_param { 3231 | group: 2 3232 | } 3233 | } 3234 | layer { 3235 | name: "stage_4_1/conv4" 3236 | type: "Convolution" 3237 | bottom: "stage_3_8/shuffle" 3238 | top: "stage_4_1/conv4" 3239 | param { 3240 | lr_mult: 1.0 3241 | decay_mult: 1.0 3242 | } 3243 | convolution_param { 3244 | num_output: 232 3245 | bias_term: false 3246 | pad: 1 3247 | kernel_size: 3 3248 | group: 232 3249 | stride: 2 3250 | weight_filler { 3251 | type: "msra" 3252 | } 3253 | dilation: 1 3254 | } 3255 | } 3256 | layer { 3257 | name: "stage_4_1/conv4/bn" 3258 | type: "BatchNorm" 3259 | bottom: "stage_4_1/conv4" 3260 | top: "stage_4_1/conv4" 3261 | param { 3262 | lr_mult: 0.0 3263 | decay_mult: 0.0 3264 | } 3265 | param { 3266 | lr_mult: 0.0 3267 | decay_mult: 0.0 3268 | } 3269 | param { 3270 | lr_mult: 0.0 3271 | decay_mult: 0.0 3272 | } 3273 | } 3274 | layer { 3275 | name: "stage_4_1/conv4/bn/scale" 3276 | type: "Scale" 3277 | bottom: "stage_4_1/conv4" 3278 | top: "stage_4_1/conv4" 3279 | param { 3280 | lr_mult: 1.0 3281 | decay_mult: 0.0 3282 | } 3283 | param { 3284 | lr_mult: 1.0 3285 | decay_mult: 0.0 3286 | } 3287 | scale_param { 3288 | filler { 3289 | type: "constant" 3290 | value: 1.0 3291 | } 3292 | bias_term: true 3293 | bias_filler { 3294 | type: "constant" 3295 | value: 0.0 3296 | } 3297 | } 3298 | } 3299 | layer { 3300 | name: "stage_4_1/conv5" 3301 | type: "Convolution" 3302 | bottom: "stage_4_1/conv4" 3303 | top: "stage_4_1/conv5" 3304 | param { 3305 | lr_mult: 1.0 3306 | decay_mult: 1.0 3307 | } 3308 | convolution_param { 3309 | num_output: 232 3310 | bias_term: false 3311 | pad: 0 3312 | kernel_size: 1 3313 | group: 1 3314 | stride: 1 3315 | weight_filler { 3316 | type: "msra" 3317 | } 3318 | dilation: 1 3319 | } 3320 | } 3321 | layer { 3322 | name: "stage_4_1/conv5/bn" 3323 | type: "BatchNorm" 3324 | bottom: "stage_4_1/conv5" 3325 | top: "stage_4_1/conv5" 3326 | param { 3327 | lr_mult: 0.0 3328 | decay_mult: 0.0 3329 | } 3330 | param { 3331 | lr_mult: 0.0 3332 | decay_mult: 0.0 3333 | } 3334 | param { 3335 | lr_mult: 0.0 3336 | decay_mult: 0.0 3337 | } 3338 | } 3339 | layer { 3340 | name: "stage_4_1/conv5/bn/scale" 3341 | type: "Scale" 3342 | bottom: "stage_4_1/conv5" 3343 | top: "stage_4_1/conv5" 3344 | param { 3345 | lr_mult: 1.0 3346 | decay_mult: 0.0 3347 | } 3348 | param { 3349 | lr_mult: 1.0 3350 | decay_mult: 0.0 3351 | } 3352 | scale_param { 3353 | filler { 3354 | type: "constant" 3355 | value: 1.0 3356 | } 3357 | bias_term: true 3358 | bias_filler { 3359 | type: "constant" 3360 | value: 0.0 3361 | } 3362 | } 3363 | } 3364 | layer { 3365 | name: "stage_4_1/conv5/relu" 3366 | type: "ReLU" 3367 | bottom: "stage_4_1/conv5" 3368 | top: "stage_4_1/conv5" 3369 | } 3370 | layer { 3371 | name: "stage_4_1/conv1" 3372 | type: "Convolution" 3373 | bottom: "stage_3_8/shuffle" 3374 | top: "stage_4_1/conv1" 3375 | param { 3376 | lr_mult: 1.0 3377 | decay_mult: 1.0 3378 | } 3379 | convolution_param { 3380 | num_output: 232 3381 | bias_term: false 3382 | pad: 0 3383 | kernel_size: 1 3384 | group: 1 3385 | stride: 1 3386 | weight_filler { 3387 | type: "msra" 3388 | } 3389 | dilation: 1 3390 | } 3391 | } 3392 | layer { 3393 | name: "stage_4_1/conv1/bn" 3394 | type: "BatchNorm" 3395 | bottom: "stage_4_1/conv1" 3396 | top: "stage_4_1/conv1" 3397 | param { 3398 | lr_mult: 0.0 3399 | decay_mult: 0.0 3400 | } 3401 | param { 3402 | lr_mult: 0.0 3403 | decay_mult: 0.0 3404 | } 3405 | param { 3406 | lr_mult: 0.0 3407 | decay_mult: 0.0 3408 | } 3409 | } 3410 | layer { 3411 | name: "stage_4_1/conv1/bn/scale" 3412 | type: "Scale" 3413 | bottom: "stage_4_1/conv1" 3414 | top: "stage_4_1/conv1" 3415 | param { 3416 | lr_mult: 1.0 3417 | decay_mult: 0.0 3418 | } 3419 | param { 3420 | lr_mult: 1.0 3421 | decay_mult: 0.0 3422 | } 3423 | scale_param { 3424 | filler { 3425 | type: "constant" 3426 | value: 1.0 3427 | } 3428 | bias_term: true 3429 | bias_filler { 3430 | type: "constant" 3431 | value: 0.0 3432 | } 3433 | } 3434 | } 3435 | layer { 3436 | name: "stage_4_1/conv1/relu" 3437 | type: "ReLU" 3438 | bottom: "stage_4_1/conv1" 3439 | top: "stage_4_1/conv1" 3440 | } 3441 | layer { 3442 | name: "stage_4_1/conv2" 3443 | type: "Convolution" 3444 | bottom: "stage_4_1/conv1" 3445 | top: "stage_4_1/conv2" 3446 | param { 3447 | lr_mult: 1.0 3448 | decay_mult: 1.0 3449 | } 3450 | convolution_param { 3451 | num_output: 232 3452 | bias_term: false 3453 | pad: 1 3454 | kernel_size: 3 3455 | group: 232 3456 | stride: 2 3457 | weight_filler { 3458 | type: "msra" 3459 | } 3460 | dilation: 1 3461 | } 3462 | } 3463 | layer { 3464 | name: "stage_4_1/conv2/bn" 3465 | type: "BatchNorm" 3466 | bottom: "stage_4_1/conv2" 3467 | top: "stage_4_1/conv2" 3468 | param { 3469 | lr_mult: 0.0 3470 | decay_mult: 0.0 3471 | } 3472 | param { 3473 | lr_mult: 0.0 3474 | decay_mult: 0.0 3475 | } 3476 | param { 3477 | lr_mult: 0.0 3478 | decay_mult: 0.0 3479 | } 3480 | } 3481 | layer { 3482 | name: "stage_4_1/conv2/bn/scale" 3483 | type: "Scale" 3484 | bottom: "stage_4_1/conv2" 3485 | top: "stage_4_1/conv2" 3486 | param { 3487 | lr_mult: 1.0 3488 | decay_mult: 0.0 3489 | } 3490 | param { 3491 | lr_mult: 1.0 3492 | decay_mult: 0.0 3493 | } 3494 | scale_param { 3495 | filler { 3496 | type: "constant" 3497 | value: 1.0 3498 | } 3499 | bias_term: true 3500 | bias_filler { 3501 | type: "constant" 3502 | value: 0.0 3503 | } 3504 | } 3505 | } 3506 | layer { 3507 | name: "stage_4_1/conv3" 3508 | type: "Convolution" 3509 | bottom: "stage_4_1/conv2" 3510 | top: "stage_4_1/conv3" 3511 | param { 3512 | lr_mult: 1.0 3513 | decay_mult: 1.0 3514 | } 3515 | convolution_param { 3516 | num_output: 232 3517 | bias_term: false 3518 | pad: 0 3519 | kernel_size: 1 3520 | group: 1 3521 | stride: 1 3522 | weight_filler { 3523 | type: "msra" 3524 | } 3525 | dilation: 1 3526 | } 3527 | } 3528 | layer { 3529 | name: "stage_4_1/conv3/bn" 3530 | type: "BatchNorm" 3531 | bottom: "stage_4_1/conv3" 3532 | top: "stage_4_1/conv3" 3533 | param { 3534 | lr_mult: 0.0 3535 | decay_mult: 0.0 3536 | } 3537 | param { 3538 | lr_mult: 0.0 3539 | decay_mult: 0.0 3540 | } 3541 | param { 3542 | lr_mult: 0.0 3543 | decay_mult: 0.0 3544 | } 3545 | } 3546 | layer { 3547 | name: "stage_4_1/conv3/bn/scale" 3548 | type: "Scale" 3549 | bottom: "stage_4_1/conv3" 3550 | top: "stage_4_1/conv3" 3551 | param { 3552 | lr_mult: 1.0 3553 | decay_mult: 0.0 3554 | } 3555 | param { 3556 | lr_mult: 1.0 3557 | decay_mult: 0.0 3558 | } 3559 | scale_param { 3560 | filler { 3561 | type: "constant" 3562 | value: 1.0 3563 | } 3564 | bias_term: true 3565 | bias_filler { 3566 | type: "constant" 3567 | value: 0.0 3568 | } 3569 | } 3570 | } 3571 | layer { 3572 | name: "stage_4_1/conv3/relu" 3573 | type: "ReLU" 3574 | bottom: "stage_4_1/conv3" 3575 | top: "stage_4_1/conv3" 3576 | } 3577 | layer { 3578 | name: "stage_4_1/concat" 3579 | type: "Concat" 3580 | bottom: "stage_4_1/conv5" 3581 | bottom: "stage_4_1/conv3" 3582 | top: "stage_4_1/concat" 3583 | concat_param { 3584 | axis: 1 3585 | } 3586 | } 3587 | layer { 3588 | name: "stage_4_1/shuffle" 3589 | type: "ShuffleChannel" 3590 | bottom: "stage_4_1/concat" 3591 | top: "stage_4_1/shuffle" 3592 | shuffle_channel_param { 3593 | group: 2 3594 | } 3595 | } 3596 | layer { 3597 | name: "stage_4_2/slice1" 3598 | type: "Slice" 3599 | bottom: "stage_4_1/shuffle" 3600 | top: "stage_4_2/slice1" 3601 | top: "stage_4_2/slice2" 3602 | slice_param { 3603 | slice_point: 232 3604 | axis: 1 3605 | } 3606 | } 3607 | layer { 3608 | name: "stage_4_2/conv1" 3609 | type: "Convolution" 3610 | bottom: "stage_4_2/slice2" 3611 | top: "stage_4_2/conv1" 3612 | param { 3613 | lr_mult: 1.0 3614 | decay_mult: 1.0 3615 | } 3616 | convolution_param { 3617 | num_output: 232 3618 | bias_term: false 3619 | pad: 0 3620 | kernel_size: 1 3621 | group: 1 3622 | stride: 1 3623 | weight_filler { 3624 | type: "msra" 3625 | } 3626 | dilation: 1 3627 | } 3628 | } 3629 | layer { 3630 | name: "stage_4_2/conv1/bn" 3631 | type: "BatchNorm" 3632 | bottom: "stage_4_2/conv1" 3633 | top: "stage_4_2/conv1" 3634 | param { 3635 | lr_mult: 0.0 3636 | decay_mult: 0.0 3637 | } 3638 | param { 3639 | lr_mult: 0.0 3640 | decay_mult: 0.0 3641 | } 3642 | param { 3643 | lr_mult: 0.0 3644 | decay_mult: 0.0 3645 | } 3646 | } 3647 | layer { 3648 | name: "stage_4_2/conv1/bn/scale" 3649 | type: "Scale" 3650 | bottom: "stage_4_2/conv1" 3651 | top: "stage_4_2/conv1" 3652 | param { 3653 | lr_mult: 1.0 3654 | decay_mult: 0.0 3655 | } 3656 | param { 3657 | lr_mult: 1.0 3658 | decay_mult: 0.0 3659 | } 3660 | scale_param { 3661 | filler { 3662 | type: "constant" 3663 | value: 1.0 3664 | } 3665 | bias_term: true 3666 | bias_filler { 3667 | type: "constant" 3668 | value: 0.0 3669 | } 3670 | } 3671 | } 3672 | layer { 3673 | name: "stage_4_2/conv1/relu" 3674 | type: "ReLU" 3675 | bottom: "stage_4_2/conv1" 3676 | top: "stage_4_2/conv1" 3677 | } 3678 | layer { 3679 | name: "stage_4_2/conv2" 3680 | type: "Convolution" 3681 | bottom: "stage_4_2/conv1" 3682 | top: "stage_4_2/conv2" 3683 | param { 3684 | lr_mult: 1.0 3685 | decay_mult: 1.0 3686 | } 3687 | convolution_param { 3688 | num_output: 232 3689 | bias_term: false 3690 | pad: 1 3691 | kernel_size: 3 3692 | group: 232 3693 | stride: 1 3694 | weight_filler { 3695 | type: "msra" 3696 | } 3697 | dilation: 1 3698 | } 3699 | } 3700 | layer { 3701 | name: "stage_4_2/conv2/bn" 3702 | type: "BatchNorm" 3703 | bottom: "stage_4_2/conv2" 3704 | top: "stage_4_2/conv2" 3705 | param { 3706 | lr_mult: 0.0 3707 | decay_mult: 0.0 3708 | } 3709 | param { 3710 | lr_mult: 0.0 3711 | decay_mult: 0.0 3712 | } 3713 | param { 3714 | lr_mult: 0.0 3715 | decay_mult: 0.0 3716 | } 3717 | } 3718 | layer { 3719 | name: "stage_4_2/conv2/bn/scale" 3720 | type: "Scale" 3721 | bottom: "stage_4_2/conv2" 3722 | top: "stage_4_2/conv2" 3723 | param { 3724 | lr_mult: 1.0 3725 | decay_mult: 0.0 3726 | } 3727 | param { 3728 | lr_mult: 1.0 3729 | decay_mult: 0.0 3730 | } 3731 | scale_param { 3732 | filler { 3733 | type: "constant" 3734 | value: 1.0 3735 | } 3736 | bias_term: true 3737 | bias_filler { 3738 | type: "constant" 3739 | value: 0.0 3740 | } 3741 | } 3742 | } 3743 | layer { 3744 | name: "stage_4_2/conv3" 3745 | type: "Convolution" 3746 | bottom: "stage_4_2/conv2" 3747 | top: "stage_4_2/conv3" 3748 | param { 3749 | lr_mult: 1.0 3750 | decay_mult: 1.0 3751 | } 3752 | convolution_param { 3753 | num_output: 232 3754 | bias_term: false 3755 | pad: 0 3756 | kernel_size: 1 3757 | group: 1 3758 | stride: 1 3759 | weight_filler { 3760 | type: "msra" 3761 | } 3762 | dilation: 1 3763 | } 3764 | } 3765 | layer { 3766 | name: "stage_4_2/conv3/bn" 3767 | type: "BatchNorm" 3768 | bottom: "stage_4_2/conv3" 3769 | top: "stage_4_2/conv3" 3770 | param { 3771 | lr_mult: 0.0 3772 | decay_mult: 0.0 3773 | } 3774 | param { 3775 | lr_mult: 0.0 3776 | decay_mult: 0.0 3777 | } 3778 | param { 3779 | lr_mult: 0.0 3780 | decay_mult: 0.0 3781 | } 3782 | } 3783 | layer { 3784 | name: "stage_4_2/conv3/bn/scale" 3785 | type: "Scale" 3786 | bottom: "stage_4_2/conv3" 3787 | top: "stage_4_2/conv3" 3788 | param { 3789 | lr_mult: 1.0 3790 | decay_mult: 0.0 3791 | } 3792 | param { 3793 | lr_mult: 1.0 3794 | decay_mult: 0.0 3795 | } 3796 | scale_param { 3797 | filler { 3798 | type: "constant" 3799 | value: 1.0 3800 | } 3801 | bias_term: true 3802 | bias_filler { 3803 | type: "constant" 3804 | value: 0.0 3805 | } 3806 | } 3807 | } 3808 | layer { 3809 | name: "stage_4_2/conv3/relu" 3810 | type: "ReLU" 3811 | bottom: "stage_4_2/conv3" 3812 | top: "stage_4_2/conv3" 3813 | } 3814 | layer { 3815 | name: "stage_4_2/concat" 3816 | type: "Concat" 3817 | bottom: "stage_4_2/slice1" 3818 | bottom: "stage_4_2/conv3" 3819 | top: "stage_4_2/concat" 3820 | concat_param { 3821 | axis: 1 3822 | } 3823 | } 3824 | layer { 3825 | name: "stage_4_2/shuffle" 3826 | type: "ShuffleChannel" 3827 | bottom: "stage_4_2/concat" 3828 | top: "stage_4_2/shuffle" 3829 | shuffle_channel_param { 3830 | group: 2 3831 | } 3832 | } 3833 | layer { 3834 | name: "stage_4_3/slice1" 3835 | type: "Slice" 3836 | bottom: "stage_4_2/shuffle" 3837 | top: "stage_4_3/slice1" 3838 | top: "stage_4_3/slice2" 3839 | slice_param { 3840 | slice_point: 232 3841 | axis: 1 3842 | } 3843 | } 3844 | layer { 3845 | name: "stage_4_3/conv1" 3846 | type: "Convolution" 3847 | bottom: "stage_4_3/slice2" 3848 | top: "stage_4_3/conv1" 3849 | param { 3850 | lr_mult: 1.0 3851 | decay_mult: 1.0 3852 | } 3853 | convolution_param { 3854 | num_output: 232 3855 | bias_term: false 3856 | pad: 0 3857 | kernel_size: 1 3858 | group: 1 3859 | stride: 1 3860 | weight_filler { 3861 | type: "msra" 3862 | } 3863 | dilation: 1 3864 | } 3865 | } 3866 | layer { 3867 | name: "stage_4_3/conv1/bn" 3868 | type: "BatchNorm" 3869 | bottom: "stage_4_3/conv1" 3870 | top: "stage_4_3/conv1" 3871 | param { 3872 | lr_mult: 0.0 3873 | decay_mult: 0.0 3874 | } 3875 | param { 3876 | lr_mult: 0.0 3877 | decay_mult: 0.0 3878 | } 3879 | param { 3880 | lr_mult: 0.0 3881 | decay_mult: 0.0 3882 | } 3883 | } 3884 | layer { 3885 | name: "stage_4_3/conv1/bn/scale" 3886 | type: "Scale" 3887 | bottom: "stage_4_3/conv1" 3888 | top: "stage_4_3/conv1" 3889 | param { 3890 | lr_mult: 1.0 3891 | decay_mult: 0.0 3892 | } 3893 | param { 3894 | lr_mult: 1.0 3895 | decay_mult: 0.0 3896 | } 3897 | scale_param { 3898 | filler { 3899 | type: "constant" 3900 | value: 1.0 3901 | } 3902 | bias_term: true 3903 | bias_filler { 3904 | type: "constant" 3905 | value: 0.0 3906 | } 3907 | } 3908 | } 3909 | layer { 3910 | name: "stage_4_3/conv1/relu" 3911 | type: "ReLU" 3912 | bottom: "stage_4_3/conv1" 3913 | top: "stage_4_3/conv1" 3914 | } 3915 | layer { 3916 | name: "stage_4_3/conv2" 3917 | type: "Convolution" 3918 | bottom: "stage_4_3/conv1" 3919 | top: "stage_4_3/conv2" 3920 | param { 3921 | lr_mult: 1.0 3922 | decay_mult: 1.0 3923 | } 3924 | convolution_param { 3925 | num_output: 232 3926 | bias_term: false 3927 | pad: 1 3928 | kernel_size: 3 3929 | group: 232 3930 | stride: 1 3931 | weight_filler { 3932 | type: "msra" 3933 | } 3934 | dilation: 1 3935 | } 3936 | } 3937 | layer { 3938 | name: "stage_4_3/conv2/bn" 3939 | type: "BatchNorm" 3940 | bottom: "stage_4_3/conv2" 3941 | top: "stage_4_3/conv2" 3942 | param { 3943 | lr_mult: 0.0 3944 | decay_mult: 0.0 3945 | } 3946 | param { 3947 | lr_mult: 0.0 3948 | decay_mult: 0.0 3949 | } 3950 | param { 3951 | lr_mult: 0.0 3952 | decay_mult: 0.0 3953 | } 3954 | } 3955 | layer { 3956 | name: "stage_4_3/conv2/bn/scale" 3957 | type: "Scale" 3958 | bottom: "stage_4_3/conv2" 3959 | top: "stage_4_3/conv2" 3960 | param { 3961 | lr_mult: 1.0 3962 | decay_mult: 0.0 3963 | } 3964 | param { 3965 | lr_mult: 1.0 3966 | decay_mult: 0.0 3967 | } 3968 | scale_param { 3969 | filler { 3970 | type: "constant" 3971 | value: 1.0 3972 | } 3973 | bias_term: true 3974 | bias_filler { 3975 | type: "constant" 3976 | value: 0.0 3977 | } 3978 | } 3979 | } 3980 | layer { 3981 | name: "stage_4_3/conv3" 3982 | type: "Convolution" 3983 | bottom: "stage_4_3/conv2" 3984 | top: "stage_4_3/conv3" 3985 | param { 3986 | lr_mult: 1.0 3987 | decay_mult: 1.0 3988 | } 3989 | convolution_param { 3990 | num_output: 232 3991 | bias_term: false 3992 | pad: 0 3993 | kernel_size: 1 3994 | group: 1 3995 | stride: 1 3996 | weight_filler { 3997 | type: "msra" 3998 | } 3999 | dilation: 1 4000 | } 4001 | } 4002 | layer { 4003 | name: "stage_4_3/conv3/bn" 4004 | type: "BatchNorm" 4005 | bottom: "stage_4_3/conv3" 4006 | top: "stage_4_3/conv3" 4007 | param { 4008 | lr_mult: 0.0 4009 | decay_mult: 0.0 4010 | } 4011 | param { 4012 | lr_mult: 0.0 4013 | decay_mult: 0.0 4014 | } 4015 | param { 4016 | lr_mult: 0.0 4017 | decay_mult: 0.0 4018 | } 4019 | } 4020 | layer { 4021 | name: "stage_4_3/conv3/bn/scale" 4022 | type: "Scale" 4023 | bottom: "stage_4_3/conv3" 4024 | top: "stage_4_3/conv3" 4025 | param { 4026 | lr_mult: 1.0 4027 | decay_mult: 0.0 4028 | } 4029 | param { 4030 | lr_mult: 1.0 4031 | decay_mult: 0.0 4032 | } 4033 | scale_param { 4034 | filler { 4035 | type: "constant" 4036 | value: 1.0 4037 | } 4038 | bias_term: true 4039 | bias_filler { 4040 | type: "constant" 4041 | value: 0.0 4042 | } 4043 | } 4044 | } 4045 | layer { 4046 | name: "stage_4_3/conv3/relu" 4047 | type: "ReLU" 4048 | bottom: "stage_4_3/conv3" 4049 | top: "stage_4_3/conv3" 4050 | } 4051 | layer { 4052 | name: "stage_4_3/concat" 4053 | type: "Concat" 4054 | bottom: "stage_4_3/slice1" 4055 | bottom: "stage_4_3/conv3" 4056 | top: "stage_4_3/concat" 4057 | concat_param { 4058 | axis: 1 4059 | } 4060 | } 4061 | layer { 4062 | name: "stage_4_3/shuffle" 4063 | type: "ShuffleChannel" 4064 | bottom: "stage_4_3/concat" 4065 | top: "stage_4_3/shuffle" 4066 | shuffle_channel_param { 4067 | group: 2 4068 | } 4069 | } 4070 | layer { 4071 | name: "stage_4_4/slice1" 4072 | type: "Slice" 4073 | bottom: "stage_4_3/shuffle" 4074 | top: "stage_4_4/slice1" 4075 | top: "stage_4_4/slice2" 4076 | slice_param { 4077 | slice_point: 232 4078 | axis: 1 4079 | } 4080 | } 4081 | layer { 4082 | name: "stage_4_4/conv1" 4083 | type: "Convolution" 4084 | bottom: "stage_4_4/slice2" 4085 | top: "stage_4_4/conv1" 4086 | param { 4087 | lr_mult: 1.0 4088 | decay_mult: 1.0 4089 | } 4090 | convolution_param { 4091 | num_output: 232 4092 | bias_term: false 4093 | pad: 0 4094 | kernel_size: 1 4095 | group: 1 4096 | stride: 1 4097 | weight_filler { 4098 | type: "msra" 4099 | } 4100 | dilation: 1 4101 | } 4102 | } 4103 | layer { 4104 | name: "stage_4_4/conv1/bn" 4105 | type: "BatchNorm" 4106 | bottom: "stage_4_4/conv1" 4107 | top: "stage_4_4/conv1" 4108 | param { 4109 | lr_mult: 0.0 4110 | decay_mult: 0.0 4111 | } 4112 | param { 4113 | lr_mult: 0.0 4114 | decay_mult: 0.0 4115 | } 4116 | param { 4117 | lr_mult: 0.0 4118 | decay_mult: 0.0 4119 | } 4120 | } 4121 | layer { 4122 | name: "stage_4_4/conv1/bn/scale" 4123 | type: "Scale" 4124 | bottom: "stage_4_4/conv1" 4125 | top: "stage_4_4/conv1" 4126 | param { 4127 | lr_mult: 1.0 4128 | decay_mult: 0.0 4129 | } 4130 | param { 4131 | lr_mult: 1.0 4132 | decay_mult: 0.0 4133 | } 4134 | scale_param { 4135 | filler { 4136 | type: "constant" 4137 | value: 1.0 4138 | } 4139 | bias_term: true 4140 | bias_filler { 4141 | type: "constant" 4142 | value: 0.0 4143 | } 4144 | } 4145 | } 4146 | layer { 4147 | name: "stage_4_4/conv1/relu" 4148 | type: "ReLU" 4149 | bottom: "stage_4_4/conv1" 4150 | top: "stage_4_4/conv1" 4151 | } 4152 | layer { 4153 | name: "stage_4_4/conv2" 4154 | type: "Convolution" 4155 | bottom: "stage_4_4/conv1" 4156 | top: "stage_4_4/conv2" 4157 | param { 4158 | lr_mult: 1.0 4159 | decay_mult: 1.0 4160 | } 4161 | convolution_param { 4162 | num_output: 232 4163 | bias_term: false 4164 | pad: 1 4165 | kernel_size: 3 4166 | group: 232 4167 | stride: 1 4168 | weight_filler { 4169 | type: "msra" 4170 | } 4171 | dilation: 1 4172 | } 4173 | } 4174 | layer { 4175 | name: "stage_4_4/conv2/bn" 4176 | type: "BatchNorm" 4177 | bottom: "stage_4_4/conv2" 4178 | top: "stage_4_4/conv2" 4179 | param { 4180 | lr_mult: 0.0 4181 | decay_mult: 0.0 4182 | } 4183 | param { 4184 | lr_mult: 0.0 4185 | decay_mult: 0.0 4186 | } 4187 | param { 4188 | lr_mult: 0.0 4189 | decay_mult: 0.0 4190 | } 4191 | } 4192 | layer { 4193 | name: "stage_4_4/conv2/bn/scale" 4194 | type: "Scale" 4195 | bottom: "stage_4_4/conv2" 4196 | top: "stage_4_4/conv2" 4197 | param { 4198 | lr_mult: 1.0 4199 | decay_mult: 0.0 4200 | } 4201 | param { 4202 | lr_mult: 1.0 4203 | decay_mult: 0.0 4204 | } 4205 | scale_param { 4206 | filler { 4207 | type: "constant" 4208 | value: 1.0 4209 | } 4210 | bias_term: true 4211 | bias_filler { 4212 | type: "constant" 4213 | value: 0.0 4214 | } 4215 | } 4216 | } 4217 | layer { 4218 | name: "stage_4_4/conv3" 4219 | type: "Convolution" 4220 | bottom: "stage_4_4/conv2" 4221 | top: "stage_4_4/conv3" 4222 | param { 4223 | lr_mult: 1.0 4224 | decay_mult: 1.0 4225 | } 4226 | convolution_param { 4227 | num_output: 232 4228 | bias_term: false 4229 | pad: 0 4230 | kernel_size: 1 4231 | group: 1 4232 | stride: 1 4233 | weight_filler { 4234 | type: "msra" 4235 | } 4236 | dilation: 1 4237 | } 4238 | } 4239 | layer { 4240 | name: "stage_4_4/conv3/bn" 4241 | type: "BatchNorm" 4242 | bottom: "stage_4_4/conv3" 4243 | top: "stage_4_4/conv3" 4244 | param { 4245 | lr_mult: 0.0 4246 | decay_mult: 0.0 4247 | } 4248 | param { 4249 | lr_mult: 0.0 4250 | decay_mult: 0.0 4251 | } 4252 | param { 4253 | lr_mult: 0.0 4254 | decay_mult: 0.0 4255 | } 4256 | } 4257 | layer { 4258 | name: "stage_4_4/conv3/bn/scale" 4259 | type: "Scale" 4260 | bottom: "stage_4_4/conv3" 4261 | top: "stage_4_4/conv3" 4262 | param { 4263 | lr_mult: 1.0 4264 | decay_mult: 0.0 4265 | } 4266 | param { 4267 | lr_mult: 1.0 4268 | decay_mult: 0.0 4269 | } 4270 | scale_param { 4271 | filler { 4272 | type: "constant" 4273 | value: 1.0 4274 | } 4275 | bias_term: true 4276 | bias_filler { 4277 | type: "constant" 4278 | value: 0.0 4279 | } 4280 | } 4281 | } 4282 | layer { 4283 | name: "stage_4_4/conv3/relu" 4284 | type: "ReLU" 4285 | bottom: "stage_4_4/conv3" 4286 | top: "stage_4_4/conv3" 4287 | } 4288 | layer { 4289 | name: "stage_4_4/concat" 4290 | type: "Concat" 4291 | bottom: "stage_4_4/slice1" 4292 | bottom: "stage_4_4/conv3" 4293 | top: "stage_4_4/concat" 4294 | concat_param { 4295 | axis: 1 4296 | } 4297 | } 4298 | layer { 4299 | name: "stage_4_4/shuffle" 4300 | type: "ShuffleChannel" 4301 | bottom: "stage_4_4/concat" 4302 | top: "stage_4_4/shuffle" 4303 | shuffle_channel_param { 4304 | group: 2 4305 | } 4306 | } 4307 | layer { 4308 | name: "conv5" 4309 | type: "Convolution" 4310 | bottom: "stage_4_4/shuffle" 4311 | top: "conv5" 4312 | param { 4313 | lr_mult: 1.0 4314 | decay_mult: 1.0 4315 | } 4316 | convolution_param { 4317 | num_output: 1024 4318 | bias_term: false 4319 | pad: 0 4320 | kernel_size: 1 4321 | group: 1 4322 | stride: 1 4323 | weight_filler { 4324 | type: "msra" 4325 | } 4326 | dilation: 1 4327 | } 4328 | } 4329 | layer { 4330 | name: "conv5/bn" 4331 | type: "BatchNorm" 4332 | bottom: "conv5" 4333 | top: "conv5" 4334 | param { 4335 | lr_mult: 0.0 4336 | decay_mult: 0.0 4337 | } 4338 | param { 4339 | lr_mult: 0.0 4340 | decay_mult: 0.0 4341 | } 4342 | param { 4343 | lr_mult: 0.0 4344 | decay_mult: 0.0 4345 | } 4346 | } 4347 | layer { 4348 | name: "conv5/bn/scale" 4349 | type: "Scale" 4350 | bottom: "conv5" 4351 | top: "conv5" 4352 | param { 4353 | lr_mult: 1.0 4354 | decay_mult: 0.0 4355 | } 4356 | param { 4357 | lr_mult: 1.0 4358 | decay_mult: 0.0 4359 | } 4360 | scale_param { 4361 | filler { 4362 | type: "constant" 4363 | value: 1.0 4364 | } 4365 | bias_term: true 4366 | bias_filler { 4367 | type: "constant" 4368 | value: 0.0 4369 | } 4370 | } 4371 | } 4372 | layer { 4373 | name: "conv5/relu" 4374 | type: "ReLU" 4375 | bottom: "conv5" 4376 | top: "conv5" 4377 | } 4378 | layer { 4379 | name: "pool" 4380 | type: "Pooling" 4381 | bottom: "conv5" 4382 | top: "pool" 4383 | pooling_param { 4384 | pool: AVE 4385 | kernel_size: 7 4386 | stride: 1 4387 | pad: 0 4388 | } 4389 | } 4390 | layer { 4391 | name: "fc" 4392 | type: "Convolution" 4393 | bottom: "pool" 4394 | top: "fc" 4395 | param { 4396 | lr_mult: 1.0 4397 | decay_mult: 1.0 4398 | } 4399 | param { 4400 | lr_mult: 1.0 4401 | decay_mult: 0.0 4402 | } 4403 | convolution_param { 4404 | num_output: 1000 4405 | bias_term: true 4406 | pad: 0 4407 | kernel_size: 1 4408 | group: 1 4409 | stride: 1 4410 | weight_filler { 4411 | type: "msra" 4412 | } 4413 | dilation: 1 4414 | } 4415 | } 4416 | -------------------------------------------------------------------------------- /slim.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | 4 | from __future__ import absolute_import 5 | from __future__ import division 6 | from __future__ import print_function 7 | 8 | import torch 9 | import torch.nn as nn 10 | 11 | try: 12 | import caffe 13 | from caffe import layers as L 14 | from caffe import params as P 15 | except ImportError: 16 | pass 17 | 18 | 19 | def g_name(g_name, m): 20 | m.g_name = g_name 21 | return m 22 | 23 | 24 | class ChannelShuffle(nn.Module): 25 | def __init__(self, groups): 26 | super(ChannelShuffle, self).__init__() 27 | self.groups = groups 28 | 29 | def forward(self, x): 30 | x = x.reshape(x.shape[0], self.groups, x.shape[1] // self.groups, x.shape[2], x.shape[3]) 31 | x = x.permute(0, 2, 1, 3, 4) 32 | x = x.reshape(x.shape[0], -1, x.shape[3], x.shape[4]) 33 | return x 34 | 35 | def generate_caffe_prototxt(self, caffe_net, layer): 36 | layer = L.ShuffleChannel(layer, group=self.groups) 37 | caffe_net[self.g_name] = layer 38 | return layer 39 | 40 | 41 | def channel_shuffle(name, groups): 42 | return g_name(name, ChannelShuffle(groups)) 43 | 44 | 45 | class Permute(nn.Module): 46 | def __init__(self, order): 47 | super(Permute, self).__init__() 48 | self.order = order 49 | 50 | def forward(self, x): 51 | x = x.permute(*self.order).contiguous() 52 | return x 53 | 54 | def generate_caffe_prototxt(self, caffe_net, layer): 55 | layer = L.Permute(layer, order=list(self.order)) 56 | caffe_net[self.g_name] = layer 57 | return layer 58 | 59 | 60 | def permute(name, order): 61 | return g_name(name, Permute(order)) 62 | 63 | 64 | class Flatten(nn.Module): 65 | def __init__(self, axis): 66 | super(Flatten, self).__init__() 67 | self.axis = axis 68 | 69 | def forward(self, x): 70 | assert self.axis == 1 71 | x = x.reshape(x.shape[0], -1) 72 | return x 73 | 74 | def generate_caffe_prototxt(self, caffe_net, layer): 75 | layer = L.Flatten(layer, axis=self.axis) 76 | caffe_net[self.g_name] = layer 77 | return layer 78 | 79 | 80 | def flatten(name, axis): 81 | return g_name(name, Flatten(axis)) 82 | 83 | 84 | def generate_caffe_prototxt(m, caffe_net, layer): 85 | if hasattr(m, 'generate_caffe_prototxt'): 86 | return m.generate_caffe_prototxt(caffe_net, layer) 87 | 88 | if isinstance(m, nn.Sequential): 89 | for module in m: 90 | layer = generate_caffe_prototxt(module, caffe_net, layer) 91 | return layer 92 | 93 | if isinstance(m, nn.Conv2d): 94 | if m.bias is None: 95 | param=[dict(lr_mult=1, decay_mult=1)] 96 | else: 97 | param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=1, decay_mult=0)] 98 | assert m.dilation[0] == m.dilation[1] 99 | convolution_param=dict( 100 | num_output=m.out_channels, 101 | group=m.groups, bias_term=(m.bias is not None), 102 | weight_filler=dict(type='msra'), 103 | dilation=m.dilation[0], 104 | ) 105 | if m.kernel_size[0] == m.kernel_size[1]: 106 | convolution_param['kernel_size'] = m.kernel_size[0] 107 | else: 108 | convolution_param['kernel_h'] = m.kernel_size[0] 109 | convolution_param['kernel_w'] = m.kernel_size[1] 110 | if m.stride[0] == m.stride[1]: 111 | convolution_param['stride'] = m.stride[0] 112 | else: 113 | convolution_param['stride_h'] = m.stride[0] 114 | convolution_param['stride_w'] = m.stride[1] 115 | if m.padding[0] == m.padding[1]: 116 | convolution_param['pad'] = m.padding[0] 117 | else: 118 | convolution_param['pad_h'] = m.padding[0] 119 | convolution_param['pad_w'] = m.padding[1] 120 | layer = L.Convolution( 121 | layer, 122 | param=param, 123 | convolution_param=convolution_param, 124 | ) 125 | caffe_net.tops[m.g_name] = layer 126 | return layer 127 | 128 | if isinstance(m, nn.ConvTranspose2d): 129 | if m.bias is None: 130 | param=[dict(lr_mult=1, decay_mult=1)] 131 | else: 132 | param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=1, decay_mult=0)] 133 | assert m.dilation[0] == m.dilation[1] 134 | convolution_param=dict( 135 | num_output=m.out_channels, 136 | group=m.groups, bias_term=(m.bias is not None), 137 | weight_filler=dict(type='msra'), 138 | dilation=m.dilation[0], 139 | ) 140 | if m.kernel_size[0] == m.kernel_size[1]: 141 | convolution_param['kernel_size'] = m.kernel_size[0] 142 | else: 143 | convolution_param['kernel_h'] = m.kernel_size[0] 144 | convolution_param['kernel_w'] = m.kernel_size[1] 145 | if m.stride[0] == m.stride[1]: 146 | convolution_param['stride'] = m.stride[0] 147 | else: 148 | convolution_param['stride_h'] = m.stride[0] 149 | convolution_param['stride_w'] = m.stride[1] 150 | if m.padding[0] == m.padding[1]: 151 | convolution_param['pad'] = m.padding[0] 152 | else: 153 | convolution_param['pad_h'] = m.padding[0] 154 | convolution_param['pad_w'] = m.padding[1] 155 | layer = L.Deconvolution( 156 | layer, 157 | param=param, 158 | convolution_param=convolution_param, 159 | ) 160 | caffe_net.tops[m.g_name] = layer 161 | return layer 162 | 163 | if isinstance(m, nn.BatchNorm2d): 164 | layer = L.BatchNorm( 165 | layer, in_place=True, 166 | param=[dict(lr_mult=0, decay_mult=0), dict(lr_mult=0, decay_mult=0), dict(lr_mult=0, decay_mult=0)], 167 | ) 168 | caffe_net[m.g_name] = layer 169 | if m.affine: 170 | layer = L.Scale( 171 | layer, in_place=True, bias_term=True, 172 | filler=dict(type='constant', value=1), bias_filler=dict(type='constant', value=0), 173 | param=[dict(lr_mult=1, decay_mult=0), dict(lr_mult=1, decay_mult=0)], 174 | ) 175 | caffe_net[m.g_name + '/scale'] = layer 176 | return layer 177 | 178 | if isinstance(m, nn.ReLU): 179 | layer = L.ReLU(layer, in_place=True) 180 | caffe_net.tops[m.g_name] = layer 181 | return layer 182 | 183 | if isinstance(m, nn.PReLU): 184 | layer = L.PReLU(layer) 185 | caffe_net.tops[m.g_name] = layer 186 | return layer 187 | 188 | if isinstance(m, nn.AvgPool2d) or isinstance(m, nn.MaxPool2d): 189 | if isinstance(m, nn.AvgPool2d): 190 | pooling_param = dict(pool=P.Pooling.AVE) 191 | else: 192 | pooling_param = dict(pool=P.Pooling.MAX) 193 | if isinstance(m.kernel_size, tuple) or isinstance(m.kernel_size, list): 194 | pooling_param['kernel_h'] = m.kernel_size[0] 195 | pooling_param['kernel_w'] = m.kernel_size[1] 196 | else: 197 | pooling_param['kernel_size'] = m.kernel_size 198 | if isinstance(m.stride, tuple) or isinstance(m.stride, list): 199 | pooling_param['stride_h'] = m.stride[0] 200 | pooling_param['stride_w'] = m.stride[1] 201 | else: 202 | pooling_param['stride'] = m.stride 203 | if isinstance(m.padding, tuple) or isinstance(m.padding, list): 204 | pooling_param['pad_h'] = m.padding[0] 205 | pooling_param['pad_w'] = m.padding[1] 206 | else: 207 | pooling_param['pad'] = m.padding 208 | layer = L.Pooling(layer, pooling_param=pooling_param) 209 | caffe_net.tops[m.g_name] = layer 210 | return layer 211 | raise Exception("Unknow module '%s' to generate caffe prototxt." % m) 212 | 213 | 214 | def convert_pytorch_to_caffe(torch_net, caffe_net): 215 | for name, m in torch_net.named_modules(): 216 | if isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d): 217 | print('convert conv:', name, m.g_name, m) 218 | caffe_net.params[m.g_name][0].data[...] = m.weight.data.cpu().numpy() 219 | if m.bias is not None: 220 | caffe_net.params[m.g_name][1].data[...] = m.bias.data.cpu().numpy() 221 | if isinstance(m, nn.BatchNorm2d): 222 | print('convert bn:', name, m.g_name, m) 223 | caffe_net.params[m.g_name][0].data[...] = m.running_mean.cpu().numpy() 224 | caffe_net.params[m.g_name][1].data[...] = m.running_var.cpu().numpy() 225 | caffe_net.params[m.g_name][2].data[...] = 1 226 | if m.affine: 227 | caffe_net.params[m.g_name + '/scale'][0].data[...] = m.weight.data.cpu().numpy() 228 | caffe_net.params[m.g_name + '/scale'][1].data[...] = m.bias.data.cpu().numpy() 229 | 230 | 231 | def conv_bn_relu(name, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1): 232 | return nn.Sequential( 233 | g_name(name, nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, False)), 234 | g_name(name + '/bn', nn.BatchNorm2d(out_channels)), 235 | g_name(name + '/relu', nn.ReLU(inplace=True)), 236 | ) 237 | 238 | 239 | def conv_bn(name, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1): 240 | return nn.Sequential( 241 | g_name(name, nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, False)), 242 | g_name(name + '/bn', nn.BatchNorm2d(out_channels)), 243 | ) 244 | 245 | 246 | def conv(name, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1): 247 | return g_name(name, nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, True)) 248 | 249 | 250 | def conv_relu(name, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1): 251 | return nn.Sequential( 252 | g_name(name, nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, True)), 253 | g_name(name + '/relu', nn.ReLU()), 254 | ) 255 | 256 | def conv_prelu(name, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1): 257 | return nn.Sequential( 258 | g_name(name, nn.Conv2d(in_channels, out_channels, kernel_size, stride, padding, dilation, groups, True)), 259 | g_name(name + '/prelu', nn.PReLU()), 260 | ) 261 | 262 | 263 | if __name__ == '__main__': 264 | 265 | class BasicBlock(nn.Module): 266 | 267 | def __init__(self, name, in_channels, middle_channels, out_channels, stride, residual): 268 | super(BasicBlock, self).__init__() 269 | self.g_name = name 270 | self.residual = residual 271 | self.conv = [ 272 | conv_bn(name + '/conv1', 273 | in_channels, in_channels, 3, stride=stride, padding=1, groups=in_channels), 274 | conv_bn_relu(name + '/conv2', in_channels, middle_channels, 1), 275 | conv_bn(name + '/conv3', middle_channels, out_channels, 1), 276 | ] 277 | self.conv = nn.Sequential(*self.conv) 278 | # self.relu = g_name(name + '/relu', nn.ReLU(inplace=True)) 279 | 280 | def forward(self, x): 281 | x = x + self.conv(x) if self.residual else self.conv(x) 282 | # x = self.relu(x) 283 | return x 284 | 285 | def generate_caffe_prototxt(self, caffe_net, layer): 286 | residual_layer = layer 287 | layer = generate_caffe_prototxt(self.conv, caffe_net, layer) 288 | if self.residual: 289 | layer = L.Eltwise(residual_layer, layer, operation=P.Eltwise.SUM) 290 | caffe_net[self.g_name + '/sum'] = layer 291 | # layer = generate_caffe_prototxt(self.relu, caffe_net, layer) 292 | return layer 293 | 294 | 295 | class Network(nn.Module): 296 | 297 | def __init__(self, num_outputs, width_multiplier=32): 298 | super(Network, self).__init__() 299 | 300 | assert width_multiplier >= 0 and width_multiplier <= 256 301 | # assert width_multiplier % 2 == 0 302 | 303 | self.network = [ 304 | g_name('data/bn', nn.BatchNorm2d(3)), 305 | conv_bn_relu('stage1/conv', 3, 32, 3, 2, 1), 306 | # g_name('stage1/pool', nn.MaxPool2d(3, 2, 0, ceil_mode=True)), 307 | ] 308 | channel = lambda i: (2**i) * int(width_multiplier) 309 | network_parameters = [ 310 | (32, channel(2) * 4, channel(2), 2, 2), 311 | (channel(2), channel(2) * 4, channel(2), 2, 4), 312 | (channel(2), channel(3) * 4, channel(3), 2, 8), 313 | (channel(3), channel(4) * 4, channel(4), 2, 4), 314 | ] 315 | for i, parameters in enumerate(network_parameters): 316 | in_channels, middle_channels, out_channels, stride, num_blocks = parameters 317 | self.network += [self._generate_stage('stage_{}'.format(i + 2), 318 | in_channels, middle_channels, out_channels, stride, num_blocks)] 319 | self.network += [ 320 | conv_bn_relu('unsqueeze', out_channels, out_channels * 4, 1), 321 | g_name('pool_fc', nn.AvgPool2d(7)), 322 | g_name('fc', nn.Conv2d(out_channels * 4, num_outputs, 1)), 323 | ] 324 | self.network = nn.Sequential(*self.network) 325 | 326 | for name, m in self.named_modules(): 327 | if any(map(lambda x: isinstance(m, x), [nn.Linear, nn.Conv1d, nn.Conv2d])): 328 | nn.init.kaiming_normal(m.weight, mode='fan_out') 329 | if m.bias is not None: 330 | nn.init.constant(m.bias, 0) 331 | 332 | def _generate_stage(self, name, in_channels, middle_channels, out_channels, stride, num_blocks): 333 | blocks = [BasicBlock(name + '_1', in_channels, middle_channels, out_channels, 2, False)] 334 | for i in range(1, num_blocks): 335 | blocks.append(BasicBlock(name + '_{}'.format(i + 1), 336 | out_channels, middle_channels, out_channels, 1, True)) 337 | return nn.Sequential(*blocks) 338 | 339 | def forward(self, x): 340 | return self.network(x).view(x.size(0), -1) 341 | 342 | def generate_caffe_prototxt(self, caffe_net, layer): 343 | return generate_caffe_prototxt(self.network, caffe_net, layer) 344 | 345 | def convert_to_caffe(self, name): 346 | caffe_net = caffe.NetSpec() 347 | layer = L.Input(shape=dict(dim=[1, 3, 224, 224])) 348 | caffe_net.tops['data'] = layer 349 | generate_caffe_prototxt(self, caffe_net, layer) 350 | print(caffe_net.to_proto()) 351 | with open(name + '.prototxt', 'wb') as f: 352 | f.write(str(caffe_net.to_proto())) 353 | caffe_net = caffe.Net(name + '.prototxt', caffe.TEST) 354 | convert_pytorch_to_caffe(self, caffe_net) 355 | caffe_net.save(name + '.caffemodel') 356 | 357 | 358 | network = Network(1000, 8) 359 | print(network) 360 | network.convert_to_caffe('net') --------------------------------------------------------------------------------