happynear / caffe-windows

Configure Caffe in one hour for Windows users.
Other
1.32k stars 649 forks source link

contrastive_loss_layer.hpp may have a problem #203

Open hwd9654 opened 7 years ago

hwd9654 commented 7 years ago

When I used the contrastive_loss_layer for deepid2,

I met a strange failure:

    F0504 15:43:11.065735 22324 layer.hpp:375] Check failed: ExactNumBottomBlobs() == bottom.size() (4          vs. 3) ContrastiveLoss Layer takes 4 bottom blob(s) as input.

So I check the bvlc/caffe code and compare the code with happynear_version.

Surprisingly, I find the contrastive_loss_layer in bvlc_version is different from the happynear_version

contrastive_loss_layer.hpp:

virtual inline int ExactNumBottomBlobs() const { return 3; } (bvlc) virtual inline int ExactNumBottomBlobs() const { return 4; } (happynear)

It means that h_version need one more input, which makes me really confused.

Besides, I check the contrastive_loss_layer.cu and contrastive_loss_layer.cpp. Both of them just used 3 bottom as input.

So I wonder if it is a mistake or some special stuff.

Hope Mr.Happynear could take a little bit of your precious time to answer my question. Thanks a lot! Have a good day!

happynear commented 7 years ago

See https://github.com/happynear/caffe-windows/issues/9 for details.

Why do you still want to try deepid2? That algorithm is difficult to reproduce. I suggest you to try center loss (https://github.com/ydwen/caffe-face) and NormFace(https://github.com/happynear/NormFace).

hwd9654 commented 7 years ago

Thanks for your reply!😁 I'll try the code.