tianzhi0549 / CTPN

Detecting Text in Natural Image with Connectionist Text Proposal Network (ECCV'16)
http://textdet.com
Other
1.28k stars 539 forks source link

error: no matching function for call to #78

Open fwang18 opened 6 years ago

fwang18 commented 6 years ago

When I tried to make -j, it reports the same error all the time. I have tried to downgrade gcc to 4 or 5, but it's not working. I have no idea what's going on...

CXX src/caffe/layers/contrastive_loss_layer.cpp src/caffe/layers/contrastive_loss_layer.cpp:56:22: error: no matching function for call to 'max' Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), 0.0); ^~~~~~~~ src/caffe/layers/contrastive_loss_layer.cpp:118:19: note: in instantiation of member function 'caffe::ContrastiveLossLayer<float>::Forward_cpu' requested here INSTANTIATE_CLASS(ContrastiveLossLayer); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:2611:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('float' vs. 'double') max(const _Tp& __a, const _Tp& __b) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:2603:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ 1 error generated. make: *** [.build_release/src/caffe/layers/contrastive_loss_layer.o] Error 1

Anyone with any ideas?

ZizhenWang commented 6 years ago

Hi, I meet the same error. Have you fix it? Can you tell me how? thx

hutuchong commented 6 years ago

std::max(margin - sqrt(distsq.cpu_data()[i]), 0.0); ---> std::max(margin - sqrt(distsq.cpu_data()[i]), Dtype(0.0));