Part Number:TMDSEVM572X
使用caffe-jacinto去训练一个网络时,定义网络的最后一层的卷积核为1*1,输出为1。训练时报错(附图),但是看官方例程的网络也有相似的结构,只是输出不一样,我是模仿官方结构的。请问问题出在哪儿?
训练报错:
官方相似结构(object detection的mobilenet结构),图中的conv3_1/sep和conv3_2/sep都是kernel为1*1,group都为1,但output channel和group是不匹配的。
本人网络最后部分:
layer {name: "fu1_1/dw"type: "Convolution"bottom: "conv7_3"top: "fu1_1/dw"convolution_param {num_output: 64bias_term: falsepad: 1kernel_size: 3group: 64stride: 1weight_filler {type: "msra"}dilation: 1} } layer {name: "fu1_1/dw/bn"type: "BatchNorm"bottom: "fu1_1/dw"top: "fu1_1/dw"batch_norm_param {scale_bias: true} } layer {name: "relu1_1/dw"type: "ReLU"bottom: "fu1_1/dw"top: "fu1_1/dw" } layer {name: "fu1_1/sep"type: "Convolution"bottom: "fu1_1/dw"top: "fu1_1/sep"convolution_param {num_output: 64bias_term: falsepad: 0kernel_size: 1group: 1stride: 1weight_filler {type: "msra"}dilation: 1} } layer {name: "fu1_1/sep/bn"type: "BatchNorm"bottom: "fu1_1/sep"top: "fu1_1/sep"batch_norm_param {scale_bias: true} } layer {name: "relu1_1/sep"type: "ReLU"bottom: "fu1_1/sep"top: "fu1_1/sep" } layer {name: "fu1_2/dw"type: "Convolution"bottom: "fu1_1/sep"top: "fu1_2/dw"convolution_param {num_output: 64bias_term: falsepad: 1kernel_size: 3group: 64stride: 1weight_filler {type: "msra"}dilation: 1} } layer {name: "fu1_2/dw/bn"type: "BatchNorm"bottom: "fu1_2/dw"top: "fu1_2/dw"batch_norm_param {scale_bias: true} } layer {name: "relu1_2/dw"type: "ReLU"bottom: "fu1_2/dw"top: "fu1_2/dw" } layer {name: "fu1_2/sep"type: "Convolution"bottom: "fu1_2/dw"top: "estdmap"convolution_param {num_output: 1bias_term: falsepad: 0kernel_size: 1group: 1stride: 1weight_filler {type: "msra"}dilation: 1} }
本人网络最后部分结构:
Shine:
请问使用的是哪个版本的软件包?
,
user6446474:
Processor SDK Linux 06_03_00_106,使用Machine Learning中TIDL部分提到的caffe-jacinto。
,
Shine:
我把您的问题转到e2e上,请关注下面的帖子。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1035218/am5728-caffe-jacinto-failed-to-train
,
user6446474:
谢谢帮助。
,
Shine:
下面是工程师的回复,请查看。
Please comment out three lines in layer_factory.cpp as shown below, recompile caffe-jacinto and it should work:
https://git.ti.com/cgit/jacinto-ai/caffe-jacinto/tree/src/caffe/layer_factory.cpp#n62
//if(conv_param.num_output() == conv_param.group()) { // return CreateLayerBase<ConvolutionDepthwiseLayer>(param, ftype, btype); //} Details:ConvolutionDepthwiseLayer is just a faster implementation specifically for Depthwise layers – it is not mandatory. The check shown above should have ensured that the input channels output channels and groups are same as done in (https://git.ti.com/cgit/jacinto-ai/caffe-jacinto/tree/src/caffe/layers/conv_dw_layer.cpp#n17) But input channels is not available inside layer_factory.cpp – so the condition to instantiate ConvolutionDepthwiseLayer is not fully correct.
Hope this helps.
,
user6446474:
已收到通知!谢谢!我按照回复尝试后,再进行反馈。
,
user6446474:
问题已解决。