-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Deconvolution Support #99
base: master
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope can help you, we badly needs it now.
lines.emplace_back(layer.name(), buf); | ||
} | ||
} | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be removed
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.proto
to match the one currently at https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto.