caffe+ error: no'void caffe' member function declared in class

根据论文提供的caffe工程编译,显示如下问题:

In file included from ./include/caffe/common.hpp:19:0, from ./include/caffe/blob.hpp:8, from ./include/caffe/layers/detection_loss_layer.hpp:6, from src/caffe/layers/detection_loss_layer.cpp:6: ./include/caffe/util/device_alternate.hpp:15:36: error: no ‘void caffe::DetectionLossLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&)’ member function declared in class ‘caffe::DetectionLossLayer<Dtype>’ const vector<Blob<Dtype>*>& top) { NO_GPU; } \ ^ src/caffe/layers/detection_loss_layer.cpp:222:1: note: in expansion of macro ‘STUB_GPU’ STUB_GPU(DetectionLossLayer); ^ ./include/caffe/util/device_alternate.hpp:19:39: error: no ‘void caffe::DetectionLossLayer<Dtype>::Backward_gpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<bool>&, const std::vector<caffe::Blob<Dtype>*>&)’ member function declared in class ‘caffe::DetectionLossLayer<Dtype>’ const vector<Blob<Dtype>*>& bottom) { NO_GPU; } \ ^ src/caffe/layers/detection_loss_layer.cpp:222:1: note: in expansion of macro ‘STUB_GPU’ STUB_GPU(DetectionLossLayer); ^ Makefile:572: recipe for target '.build_release/src/caffe/layers/detection_loss_layer.o' failed make: *** [.build_release/src/caffe/layers/detection_loss_layer.o] Error 1 make: *** Waiting for unfinished jobs....


在网上找到答案如下:

You can try removing the following lines in the detection_loss_layer.cpp

#ifdef CPU_ONLY STUB_GPU(DetectionLossLayer); #endif


解决了该问题。

猜你喜欢

转载自blog.csdn.net/yangpan011/article/details/80586728
今日推荐