New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when compiling using cmake: contrastive_loss_layer.cpp: error: no matching function for call to 'max(float, double)' #60
Comments
The issue was with gcc and g++ versions. I downgraded them from version 6 to 5 and that solved the problem |
Hi, I have encountered same question, but downgrade gcc doesn't solve the problem. Can you be more specific? |
Hi fwang18, Casting output of 'sqrt' function solved the problem for me. |
Hello, I have encountered the same problem in the learning process. How did you solve it?Thank you. |
In my case, casting to |
|
1 similar comment
|
I am trying to compile your version of Caffe and miserably have faced this issue that I don't seem to be able to solve it. I appreciate hints from anyone.
Here's what I do:
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : (Caffe doesn't declare its version in headers)
-- Git : 1595004-dirty
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : ON
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : ON
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.62)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 3.0.0)
-- lmdb : Yes (ver. 0.9.18)
-- Snappy : Yes (ver. 1.1.3)
-- LevelDB : Yes (ver. 1.18)
-- OpenCV : Yes (ver. 2.4.9.1)
-- CUDA : No
-- Python:
-- Interpreter : /usr/bin/python2.7 (ver. 2.7.13)
-- Libraries : /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.13)
-- NumPy : /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
-- Documentaion:
-- Doxygen : No
-- config_file :
-- Install:
-- Install path : /data/CTPN/caffe/build/install
-- Configuring done
-- Generating done
-- Build files have been written to: /data/CTPN/caffe/build
[ 14%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/contrastive_loss_layer.cpp.o
[ 14%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/conv_layer.cpp.o
/home/CTPN/caffe/src/caffe/layers/contrastive_loss_layer.cpp: In instantiation of 'void caffe::ContrastiveLossLayer::Forward_cpu(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]':
/home/CTPN/caffe/src/caffe/layers/contrastive_loss_layer.cpp:118:1: required from here
/home/CTPN/caffe/src/caffe/layers/contrastive_loss_layer.cpp:56:30: error: no matching function for call to 'max(float, double)'
Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have managed and used original version of caffe. Although I faced all types of error during its compilation, except this one.
Many thanks in advance.
The text was updated successfully, but these errors were encountered: