Slice layer in caffe

1,246 views
Skip to first unread message

Dzung Nguyen

unread,
Nov 2, 2015, 8:55:20 PM11/2/15
to Caffe Users
I defined the following slice layer, where I want to split Nx6xHxW into 2 Nx3xHxW blobs

layer {
  name
: "slice_pair"
  type
: "Slice"
  bottom
: "pair_data"
  top
: "data"
  top
: "data_p"
  slice_param
{
    axis
: 1
    slice_point
: 3
 
}
}

However when I run the training, caffe splits into two same size blobs

I1102 19:38:42.767278 30896 data_layer.cpp:44] output data size: 1,6,256,256
I1102
19:38:42.768590 30896 net.cpp:156] Setting up data
I1102
19:38:42.768628 30896 net.cpp:164] Top shape: 1 6 256 256 (393216)
I1102
19:38:42.768638 30896 layer_factory.hpp:76] Creating layer data_data_0_split
I1102
19:38:42.768654 30896 net.cpp:111] Creating Layer data_data_0_split
I1102
19:38:42.768661 30896 net.cpp:478] data_data_0_split <- data
I1102
19:38:42.768671 30896 net.cpp:434] data_data_0_split -> data_data_0_split_0
I1102
19:38:42.768682 30896 net.cpp:434] data_data_0_split -> data_data_0_split_1
I1102
19:38:42.768692 30896 net.cpp:156] Setting up data_data_0_split
I1102
19:38:42.768700 30896 net.cpp:164] Top shape: 1 6 256 256 (393216)
I1102
19:38:42.768707 30896 net.cpp:164] Top shape: 1 6 256 256 (393216)


How do I fix this problem?

Nicolai Harich

unread,
Nov 5, 2015, 8:38:26 AM11/5/15
to Caffe Users
Hi,

try to change "axis" to "slice_dim":

layer {
  name
: "slice_pair"
  type
: "Slice"
  bottom
: "pair_data"
  top
: "data"
  top
: "data_p"
  slice_param
{

    slice_dim: 1

    slice_point
: 3
 
}
}

Cheers
Nicolai
Message has been deleted

Song Wang

unread,
May 27, 2016, 12:00:54 PM5/27/16
to Caffe Users
Hi,
can you explain what's the difference between "slice_dim" and "axis"?
thanks a lot!
by the way,I have find this(https://groups.google.com/forum/#!topic/caffe-users/9SrQ0S2g8NM),but I dont understand it...
在 2015年11月5日星期四 UTC+8下午9:38:26,Nicolai Harich写道:
Reply all
Reply to author
Forward
0 new messages