microsoft / caffe

Caffe on both Linux and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check failed: ExactNumBottomBlobs() == bottom.size() (2 vs. 3) SoftmaxWithLoss Layer takes 2 bottom blob(s) as input

opened this issue · comments

Hello:
When I use your caffe to train faster rcnn's RPN, I meet this problem:

proposal_cls_score_reshape_proposal_cls_score_reshape_0_split_0
I0917 13:23:32.705237 11568 net.cpp:444] loss <- labels_reshape_labels_reshape_0_split_0
I0917 13:23:32.705237 11568 net.cpp:444] loss <- labels_weights_reshape
I0917 13:23:32.705237 11568 net.cpp:418] loss -> loss_cls

F0917 13:23:32.705237 11568 layer.hpp:385] Check failed: ExactNumBottomBlobs() == bottom.size() (2 vs. 3) SoftmaxWithLoss Layer takes 2 bottom blob(s) as input.
F0917 13:23:32.705237 11568 layer.hpp:385] Check failed: ExactNumBottomBlobs() == bottom.size() (2 vs. 3) SoftmaxWithLoss Layer takes 2 bottom blob(s) as input.

Help me!
Thanks!

I had the same problem. I think you are using the matlab implementation too, not the python. The matlab implementation relies on a different softmax_with_loss that takes 3 inputs not 2. One more input is the weight. This branch doesn't have the same softmax_with_loss as Faster RCNN does. I think the softmax_with_loss has to be added from https://github.com/ShaoqingRen/caffe/blob/062f2431162165c658a42d717baf8b74918aa18e/src/caffe/layers/softmax_loss_layer.cu