You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good day,
Please, I'm having a problem setting up the caffe, because I get an error from the constrative_loss file, is like their is something wrong with file and how do I fix. thank you and I wait in anticipation for your reply.
Best Regards
Alex Gbenimachor
Below is the Error in the code.
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]’:
src/caffe/layers/contrastive_loss_layer.cpp:116:1: required from here
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54:30: note: mismatched types ‘std::initializer_list<Tp>’ and ‘float’
Dtype dist = std::max(margin - sqrt(dist_sq.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:552: recipe for target '.build_release/src/caffe/layers/contrastive_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/contrastive_loss_layer.o] Error 1
The text was updated successfully, but these errors were encountered:
Good day,
Please, I'm having a problem setting up the caffe, because I get an error from the constrative_loss file, is like their is something wrong with file and how do I fix. thank you and I wait in anticipation for your reply.
Best Regards
Alex Gbenimachor
Below is the Error in the code.
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]’:
src/caffe/layers/contrastive_loss_layer.cpp:116:1: required from here
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54: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 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:
src/caffe/layers/contrastive_loss_layer.cpp:54:30: note: mismatched types ‘std::initializer_list<Tp>’ and ‘float’
Dtype dist = std::max(margin - sqrt(dist_sq.cpu_data()[i]), 0.0);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:552: recipe for target '.build_release/src/caffe/layers/contrastive_loss_layer.o' failed
make: *** [.build_release/src/caffe/layers/contrastive_loss_layer.o] Error 1
The text was updated successfully, but these errors were encountered: