-
Notifications
You must be signed in to change notification settings - Fork 451
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
Build issue #124
Comments
How did you solve this problem? |
this is the solution. It is a fix for CPU only: |
In my case, I had the gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) The way that worked for me was: Or updating the gcc, from version 5 to 7. (: |
@bermudezarii plz help me |
When I had this problem, I didn't try changing the version, but that could be that you don't have that gcc like "default". Tell me then if you had the same problem. |
@bermudezarii this ERROR is solved by Replacing Line no 56 of contrastive_loss_layer.cpp file |
@bermudezarii I am waiting for your response |
I'm building caffe-segnet on ubuntu 17.10 in modalities CPU-only.
I have this error on terminal. Anyone can help me? I'm a beginner
CXX src/caffe/layer_factory.cpp
CXX src/caffe/common.cpp
CXX src/caffe/solver.cpp
CXX src/caffe/util/upgrade_proto.cpp
CXX src/caffe/util/io.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/cudnn.cpp
CXX src/caffe/util/insert_splits.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/db.cpp
CXX src/caffe/util/math_functions.cpp
CXX src/caffe/blob.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layers/deconv_layer.cpp
CXX src/caffe/layers/filter_layer.cpp
CXX src/caffe/layers/inner_product_layer.cpp
CXX src/caffe/layers/power_layer.cpp
CXX src/caffe/layers/loss_layer.cpp
CXX src/caffe/layers/silence_layer.cpp
CXX src/caffe/layers/infogain_loss_layer.cpp
CXX src/caffe/layers/relu_layer.cpp
CXX src/caffe/layers/cudnn_relu_layer.cpp
CXX src/caffe/layers/prelu_layer.cpp
CXX src/caffe/layers/concat_layer.cpp
CXX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/hdf5_data_layer.cpp
CXX src/caffe/layers/hinge_loss_layer.cpp
CXX src/caffe/layers/memory_data_layer.cpp
CXX src/caffe/layers/conv_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layers/base_data_layer.cpp
CXX src/caffe/layers/dense_image_data_layer.cpp
CXX src/caffe/layers/data_layer.cpp
CXX src/caffe/layers/split_layer.cpp
CXX src/caffe/layers/exp_layer.cpp
CXX src/caffe/layers/cudnn_softmax_layer.cpp
CXX src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp
CXX src/caffe/layers/hdf5_output_layer.cpp
CXX src/caffe/layers/reshape_layer.cpp
CXX src/caffe/layers/accuracy_layer.cpp
CXX src/caffe/layers/cudnn_conv_layer.cpp
CXX src/caffe/layers/contrastive_loss_layer.cpp
src/caffe/layers/contrastive_loss_layer.cpp: In instantiation of ‘void caffe::ContrastiveLossLayer<Dtype>::Forward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = float]’: src/caffe/layers/contrastive_loss_layer.cpp:118:1: required from here
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++/7/algorithm:61:0, from src/caffe/layers/contrastive_loss_layer.cpp:1: /usr/include/c++/7/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^~~
/usr/include/c++/7/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
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++/7/algorithm:61:0, from src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/7/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++/7/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
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++/7/algorithm:62:0, from src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: candidate: template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^~~
/usr/include/c++/7/bits/stl_algo.h:3462:5: note: template argument deduction/substitution failed:
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++/7/algorithm:62:0, from src/caffe/layers/contrastive_loss_layer.cpp:1:
/usr/include/c++/7/bits/stl_algo.h:3468: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++/7/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
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); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:526: 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: