Adding Deconvolution Support#99
Conversation
|
Okay wait, this actually might not be working perfectly. I tried loading a fully convolutionalized version of AlexNet from here (using
The output is: There's no mention of the deconvolution layer named "upscore", present towards the end of the net (in the train.prototxt file); Could this be because it's followed by another unrecognized layer type ('Crop')? The only good news is that it's no longer complaining about not finding 'module 'data [type Deconvolution]'' anymore. |
Naruto-Sasuke
left a comment
There was a problem hiding this comment.
In loadcaffe.cpp, line 203, break should be removed.
Also your pull cannot work for deconv layer as the bias copy
inconsistent. (I don't know how to directly comment the exact line..)
Naruto-Sasuke
left a comment
There was a problem hiding this comment.
Hope can help you, we badly needs it now.
| lines.emplace_back(layer.name(), buf); | ||
| } | ||
| } | ||
| break; |
| bool biasTerm = param.bias_term(); | ||
| int groups = param.group() == 0 ? 1 : param.group(); | ||
| auto &wB = layer.blobs(0); | ||
| int nInputPlane = (wB.has_shape() ? wB.shape().dim(1) : wB.channels())*groups; |
There was a problem hiding this comment.
I don't know whether it is right to exchange nInputPlane with nOutputPlane. However it actually avoid mistakes in https://github.com/szagoruyko/loadcaffe/blob/master/loadcaffe.lua#L39 . However it also gives wrong loading info in
https://github.com/szagoruyko/loadcaffe/blob/master/loadcaffe.cpp#L692 . (Specially for FullConvolution, then printf("%s: %d %d %d %d\n", name, nInputPlane, nOutputPlane, kW, kH) is right....)
I needed to convert the Deconvolution layers in some Caffe models for a paper I was implementing in Torch. I thought it would be a good idea to put in a pull request for the added support.
I've also updated the
caffe.prototo match the one currently at https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto.