alexgkendall / caffe-segnet

Implementation of SegNet: A Deep Convolutional Encoder-Decoder Architecture for Semantic Pixel-Wise Labelling
http://mi.eng.cam.ac.uk/projects/segnet/
Other
1.08k stars 452 forks source link

fix CPU-only compilability #123

Closed A1-Triard closed 6 years ago

elcronos commented 6 years ago

I got an error with the last merge. Please verify this bug.

screen shot 2018-03-23 at 4 26 43 pm
Screenium commented 6 years ago

I have the same issue with the latest merge as @elcronos . Using Ubuntu 14.

$ make all [ 3%] Built target proto Scanning dependencies of target caffe [ 3%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/contrastive_loss_layer.cpp.o /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/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]’: /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/src/caffe/layers/contrastive_loss_layer.cpp:118:1: required from here /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/src/caffe/layers/contrastive_loss_layer.cpp:56:30: error: no matching function for call to ‘max(double, float)’ Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), Dtype(0.0)); ^ In file included from /usr/include/c++/5/algorithm:61:0, from /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/src/caffe/layers/contrastive_loss_layer.cpp:1: /usr/include/c++/5/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/5/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed: /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: deduced conflicting types for parameter ‘const _Tp’ (‘double’ and ‘float’) Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), Dtype(0.0)); ^ In file included from /usr/include/c++/5/algorithm:61:0, from /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/src/caffe/layers/contrastive_loss_layer.cpp:1: /usr/include/c++/5/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/5/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed: /home/*/Documents/work/segnet/caffe-segnet-segnet-cleaned/src/caffe/layers/contrastive_loss_layer.cpp:56:30: note: deduced conflicting types for parameter ‘const _Tp’ (‘double’ and ‘float’) Dtype dist = std::max(margin - sqrt(dist_sq_.cpu_data()[i]), Dtype(0.0)); ^ src/caffe/CMakeFiles/caffe.dir/build.make:1226: 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:240: 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

AliRaza21918 commented 6 years ago

I have the same issue ubuntu16.04 how you fixed this @Screenium @elcronos
help me plz I am in huge trouble trying to fix this from last couple of days any help will be appreciated

A1-Triard commented 6 years ago

Which BLAS you use? MKL?