yonghenglh6 / DepthwiseConvolution

A personal depthwise convolution layer implementation on caffe by liuhao.(only GPU)
525 stars 185 forks source link

about some details #13

Closed dlyldxwl closed 6 years ago

dlyldxwl commented 6 years ago

Thanks for your job! But I have some questions to ask you , I hope you can help me.

  1. Merge the caffe folder in the repo with my own caffe, and replace the type of dw layer to DepthwiseConvolution in deploy.prototxt , test speed is faster. But when I train the caffemodel, i use convlution rather than DepthwiseConvolution, that means DepthwiseConvolution is the same as convlution? And I don't add DepthwiseConvolution layer to caffe.proto,why it can work? 2.when I train the mobilenet ,I ues DepthwiseConvolution,but the speed of train is also slow ,because the caffe.proto doesn't have DepthwiseConvolution layer ?
mameng1 commented 6 years ago

caffe adds new layer via cpp file,in the file of depthwise_conv_layer.cpp,you can find REGISTER_LAYER_CLASS(DepthwiseConvolution);,Only when you want to add new parameters for this layer, these parameters can be added in caffe.proto.the depthwiseconvlution use the convolution_param layer { name: "conv2_1/dw" type: "DepthwiseConvolution" bottom: "conv1" top: "conv2_1/dw" param { lr_mult: 1.0 decay_mult: 1.0 } convolution_param { num_output: 32 bias_term: false pad: 1 kernel_size: 3 group: 32 stride: 1 weight_filler { type: "msra" } } } and This convolution_param already exists in caffe.proto, so there is no need to add new layer_param

mameng1 commented 6 years ago

i think you picture is large,so the speed is slow

dlyldxwl commented 6 years ago

@mameng1 ok, i get it, thank you. can you tell me the role of cu file? and when to use cu file? thanks!

mameng1 commented 6 years ago

if you Compile the cu file,and caffe.set_mode_gpu(),It will automatically call the cu file

dlyldxwl commented 6 years ago

@mameng1 Thanks again!