layer { name: "resx1_conv2" type: "ConvolutionDepthwise" bottom: "resx1_conv1" top: "resx1_conv2" convolution_param { num_output: 54 kernel_size: 3 stride: 2 pad: 1 bias_term: false weight_filler { type: "msra" } } }
需要修改为:
layer { name: "resx1_conv2" type: "Convolution" bottom: "resx1_conv1" top: "resx1_conv2" convolution_param { num_output: 54 group: 54 kernel_size: 3 stride: 2 pad: 1 bias_term: false weight_filler { type: "msra" } } }
如果DepthwiseConv和ConvolutionDepthwise中已携带group属性,则只修改type为Convolution即可;如果没有携带group属性,则需添加group属性: group==num_output(group、output_channel和input_channel必须相同)
修改后的模型文件(.prototxt)和权重文件(.caffemodel)的op name、op type必须保持名称一致(包括大小写)。