-
Notifications
You must be signed in to change notification settings - Fork 525
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
building errors #43
Comments
Have the same issue! |
Have you solved this ? |
If anyone still wondering, just go into the file and add float() to the variables should get rid of this. |
Replace line 56 by this one : |
Dtype dist = std::max(margin - (double)sqrt(dist_sq_.cpu_data()[i]), 0.0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OS: Ubuntu 17.04
Thanks for any help :)
Compilation worked (after commenting out add_subdirectory line for examples), but running into errors with building:
[ 14%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/concat_layer.cpp.o
[ 16%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/contrastive_loss_layer.cpp.o
/home/daniel/Desktop/cats/hed/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/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:118:1: required from here
/home/daniel/Desktop/cats/hed/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);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/algorithm:61:0,
from /home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: candidate: template constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
/home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: deduced conflicting types for parameter ‘const Tp’ (‘float’ and ‘double’)
Dtype dist = std::max(margin - sqrt(dist_sq.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/algorithm:61:0,
from /home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
/home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: deduced conflicting types for parameter ‘const Tp’ (‘float’ and ‘double’)
Dtype dist = std::max(margin - sqrt(dist_sq.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/algorithm:62:0,
from /home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/6/bits/stl_algo.h:3459:5: note: candidate: template constexpr _Tp std::max(std::initializer_list<_Tp>)
max(initializer_list<_Tp> __l)
^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note: template argument deduction/substitution failed:
/home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: mismatched types ‘std::initializer_list<Tp>’ and ‘float’
Dtype dist = std::max(margin - sqrt(dist_sq.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/algorithm:62:0,
from /home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/6/bits/stl_algo.h:3465:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)
max(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algo.h:3465:5: note: template argument deduction/substitution failed:
/home/daniel/Desktop/cats/hed/src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: mismatched types ‘std::initializer_list<Tp>’ and ‘float’
Dtype dist = std::max(margin - sqrt(dist_sq.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/caffe/CMakeFiles/caffe.dir/build.make:398: recipe for target 'src/caffe/CMakeFiles/caffe.dir/layers/contrastive_loss_layer.cpp.o' failed
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/layers/contrastive_loss_layer.cpp.o] Error 1
CMakeFiles/Makefile2:272: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered: