caffe-segnet
caffe-segnet copied to clipboard
make runtest fail
OS:: Ubuntu16.04 CPU_ONLY
I have make changes in the line 56 of "contrastive_loss_layer.cpp" file to fix an error while make all Dtype dist = std::max(margin - (float)sqrt(dist_sq_.cpu_data()[i]), Dtype(0.0)); here “(float)” is added
So when I executed make runtest my terminal display this result
CXX src/caffe/test/test_power_layer.cpp
In file included from src/caffe/test/test_power_layer.cpp:12:0:
./include/caffe/test/test_gradient_check_util.hpp: In instantiation of ‘void caffe::GradientChecker<Dtype>::CheckGradientSingle(caffe::Layer<Dtype>, const std::vector<caffe::Blob<Dtype>>&, const std::vector<caffe::Blob<Dtype>>&, int, int, int, bool) [with Dtype = float]’:
./include/caffe/test/test_gradient_check_util.hpp:208:26: required from ‘void caffe::GradientChecker<Dtype>::CheckGradientEltwise(caffe::Layer<Dtype>, const std::vector<caffe::Blob<Dtype>>&, const std::vector<caffe::Blob<Dtype>>&) [with Dtype = float]’
src/caffe/test/test_power_layer.cpp:78:5: required from ‘void caffe::PowerLayerTest<TypeParam>::TestBackward(caffe::PowerLayerTest<TypeParam>::Dtype, caffe::PowerLayerTest<TypeParam>::Dtype, caffe::PowerLayerTest<TypeParam>::Dtype) [with TypeParam = caffe::CPUDevice
Somebody plz help me
@alexgkendall plz help me to solve this problem
I solved this by changing the line 168 in test_gradient_check_util.hpp to (float)(std::max(fabs(computed_gradient), fabs(estimated_gradient))), (float)1.);
I solved this by changing the Dtype scale = std::max( std::max(fabs(computed_gradient), fabs(estimated_gradient)), 1.);
to Dtype scale = std::max<Dtype>( std::max(fabs(computed_gradient), fabs(estimated_gradient)), Dtype(1.));