How to concat the output of a pooling layer and inner-product layer in CAFFE?

337 views
Skip to first unread message

fby...@gmail.com

unread,
Dec 3, 2015, 10:52:55 PM12/3/15
to Caffe Users
While trying to concat the output of a pooling layer (pooling a convolution layer) with the outputs of an inner product layer, I got the following error:

   
 Check failed: num_axes == bottom[i]->num_axes() (4 vs. 2) All inputs must have the same #axes.



I would like to concat both and feed them into another (fully-connected) inner-product layer.
I don't mind flattening the output of the conv layer.

Can anyone suggests how to solve this?

my concat layer definition is:

    layer {
      type
: "Concat"
      bottom
: "pool3"
      bottom
: "ip1_prior"
      top
: "ip1_combine"
      name
: "concat"
   
}



Thank you!

fby...@gmail.com

unread,
Dec 3, 2015, 11:46:55 PM12/3/15
to Caffe Users
Solved my issue by flattening the conv. layer output.

e.g. by adding a Flatten layer between the pool and concat layers:

layer {
  type
: "Flatten"
  bottom
: "pool3"
  top
: "pool3flat"
  name
: "p3flat"
}


layer
{

  type
: "Concat"
  bottom
: "pool3flat"
Reply all
Reply to author
Forward
0 new messages