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

Error occurred when make resource code #140

Open wangq95 opened 6 years ago

wangq95 commented 6 years ago

Error information: In instantiation of ‘void caffe::ContrastiveLossLayer::Forward_cpu(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&) [with Dtype = float]’

Open src/caffe/layers/contrastive_loss_layer.cpp Replace the 56th line with: Dtype dist = std::max(margin - (float)sqrt(distsq.cpu_data()[i]), Dtype(0.0));

Save and remake, the problem solved.