Bug in custom caffe layer; (Error : [blob.cpp:115] Check failed: data_); Layer has multiple outputs

547 views
Skip to first unread message

nukeb...@gmail.com

unread,
Jul 22, 2016, 2:46:26 AM7/22/16
to Caffe Users
Hi.

Hey. I'm writing a caffe layer but there's a bug I haven't been able to fix for sometime. Broadly speaking, the layer has two inputs, one for a blob of data (say image data) and the other a blob of 1x1 selector data. The layer can have multiple top blobs. The selector data decides which image is feed-forwarded to which top blob. For example, I can have:

add_axes = lambda x : x[:, np.newaxis, np.newaxis]
ip
= add_axes(np.array([2, 16, 13, 23]))
sel
= add_axes(np.array([0, 0, 0, 0]))   # route all to 0th top layer
sel1
= add_axes(np.array([0, 0, 1, 0]))   # route blob[0, 1, 3] to 1st top layer, and blob[2] to 2nd top layer


**Error**: When I use `sel1` things work out fine. But when I use `sel` i.e. all the data is directed to only one of the top layers, then I get an error on `net.forward()`.
I get the error `F0722 11:30:05.099633 22747 blob.cpp:115] Check failed: data_`.


To view the prototxt:
https://gist.github.com/altairmn/7312083b0c83a670556637f71bd3c02c

To view a schematic of the network:
ethereon.github.io/netscope/#/gist/7312083b0c83a670556637f71bd3c02c

To view the caffe log:
http://hastebin.com/oneyeredin.css

An ipython notebook to reproduce the error:
https://gist.github.com/altairmn/5672b2c86c9b0b5ffccb57f83f268fe5

Anybody know how to solve it?

Thanks.

Javier Atadía

unread,
Jul 27, 2016, 11:10:30 AM7/27/16
to Caffe Users
Hello,

Have you defined the reshape for all the top layers in your custom layer?

like:

def reshape(self, bottom, top):
top[0].reshape(4,1,1)
top[1].reshape(4,1,1)


If you had, can you provide the python layer to be fully able to check?

Fateh Singh

unread,
Jun 24, 2017, 7:24:47 AM6/24/17
to Caffe Users
@nukeb
were you able to solve the error ? I have a similar error... I am also writing a custom layer (but in c++)
Reply all
Reply to author
Forward
0 new messages