按照网上的教程配置好caffe的环境后
make all -j8
最后出现
non-virtual thunk to caffe::BasePrefetchingDataLayer< float > InternalThreadEntry ()
最后各种查找,google,竟然在http://discuss.cocos2d-x.org/t/error-non-virtual-thunk-to-cocos2d-cclayer-cctouchbegan/9061中一个
回答中找到了一个回答,是由于多类继承中导致了时间上的问题
一想,应该是开始用多线程编译的时候出现的,也比较奇怪,在ubuntu14.04 TLS就没有这个问题
最后将原来编译的全部clean掉,之前有试过用单线程编译,但是忘记了clean,最后导致问题
make clean
make all
就行了
补充。之前在编译到33%时遇到一个奇葩的问题,\caffe-master\src\caffe\layers\base_conv_layer.cpp中出现一个类ConvolutionParameter 识别不了
namespace caffe {
template <typename Dtype>
void BaseConvolutionLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
CHECK_EQ(4, bottom[0]->num_axes()) << "Input must have 4 axes, "
<< "corresponding to (num, channels, height, width)";
// Configure the kernel size, padding, stride, and inputs.
ConvolutionParameter conv_param = this->layer_param_.convolution_param();
CHECK(!conv_param.has_kernel_size() !=
!(conv_param.has_kernel_h() && conv_param.has_kernel_w()))
<< "Filter size is kernel_size OR kernel_h and kernel_w; not both";
CHECK(conv_param.has_kernel_size() ||
(conv_param.has_kernel_h() && conv_param.has_kernel_w()))
<< "For non-square filters both kernel_h and kernel_w are required.";
CHECK((!conv_param.has_pad() && conv_param.has_pad_h()
&& conv_param.has_pad_w())
|| (!conv_param.has_pad_h() && !conv_param.has_pad_w()))
<< "pad is pad OR pad_h and pad_w are required.";
CHECK((!conv_param.has_stride() && conv_param.has_stride_h()
&& conv_param.has_stride_w())
|| (!conv_param.has_stride_h() && !conv_param.has_stride_w()))
<< "Stride is stride OR stride_h and stride_w are required.";
if (conv_param.has_kernel_size()) {
kernel_h_ = kernel_w_ = conv_param.kernel_size();
} else {
kernel_h_ = conv_param.kernel_h();
kernel_w_ = conv_param.kernel_w();
}
CHECK_GT(kernel_h_, 0) << "Filter dimensions cannot be zero.";
CHECK_GT(kernel_w_, 0) << "Filter dimensions cannot be zero.";
if (!conv_param.has_pad_h()) {
pad_h_ = pad_w_ = conv_param.pad();
} else {
pad_h_ = conv_param.pad_h();
pad_w_ = conv_param.pad_w();
}
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:CentOs编译caffe的问题 - Python技术站