win10上安装caffe,编译libcaffe遇到这个问题,有大佬知道怎么解决吗
错误 3771 error : class "caffe::Blob<float>" has no member "gpu_shape" E:\google\caffe-master\caffe-master\src\caffe\layers\im2col_layer.cu 27 1 libcaffe
配置:win10,caffe-master,cuda8.0,cudnn8.0
im2col_layer.cu代码
#include <vector>
#include "caffe/layers/im2col_layer.hpp"
#include "caffe/util/im2col.hpp"
namespace caffe {
template <typename Dtype>
void Im2colLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
const Dtype* bottom_data = bottom[0]->gpu_data();
Dtype* top_data = top[0]->mutable_gpu_data();
const int num_kernels = channels_ * top[0]->count(channel_axis_ + 1);
for (int n = 0; n < num_; ++n) {
if (!force_nd_im2col_ && num_spatial_axes_ == 2) {
im2col_gpu(bottom_data + n * bottom_dim_, channels_,
bottom[0]->shape(channel_axis_ + 1),
bottom[0]->shape(channel_axis_ + 2),
kernel_shape_.cpu_data()[0], kernel_shape_.cpu_data()[1],
pad_.cpu_data()[0], pad_.cpu_data()[1],
stride_.cpu_data()[0], stride_.cpu_data()[1],
dilation_.cpu_data()[0], dilation_.cpu_data()[1],
top_data + n * top_dim_);
} else {
im2col_nd_gpu(bottom_data + n * bottom_dim_, num_spatial_axes_,
num_kernels, bottom[0]->gpu_shape() + channel_axis_,
top[0]->gpu_shape() + channel_axis_,
kernel_shape_.gpu_data(), pad_.gpu_data(), stride_.gpu_data(),
dilation_.gpu_data(), top_data + n * top_dim_);
}
}
}
template <typename Dtype>
void Im2colLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
const Dtype* top_diff = top[0]->gpu_diff();
Dtype* bottom_diff = bottom[0]->mutable_gpu_diff();
for (int n = 0; n < num_; ++n) {
if (!force_nd_im2col_ && num_spatial_axes_ == 2) {
col2im_gpu(top_diff + n * top_dim_, channels_,
bottom[0]->shape(channel_axis_ + 1),
bottom[0]->shape(channel_axis_ + 2),
kernel_shape_.cpu_data()[0], kernel_shape_.cpu_data()[1],
pad_.cpu_data()[0], pad_.cpu_data()[1],
stride_.cpu_data()[0], stride_.cpu_data()[1],
dilation_.cpu_data()[0], dilation_.cpu_data()[1],
bottom_diff + n * bottom_dim_);
} else {
col2im_nd_gpu(top_diff + n * top_dim_, num_spatial_axes_, bottom_dim_,
bottom[0]->gpu_shape() + channel_axis_,
top[0]->gpu_shape() + channel_axis_,
kernel_shape_.gpu_data(), pad_.gpu_data(), stride_.gpu_data(),
dilation_.gpu_data(), bottom_diff + n * bottom_dim_);
}
}
}
INSTANTIATE_LAYER_GPU_FUNCS(Im2colLayer);
} // namespace caffe
还跟着这个错误,希望大佬帮忙解答一下
错误 25 error MSB3721: 命令“"..........\cuda\GPU\CUDA\v8.0\bin\nvcc.exe" -gencode=arch=compute_35,code="sm_35,compute_35" -gencode=arch=compute_52,code="sm_52,compute_52" --use-local-env --cl-version 2013 -ccbin "E:\VS2013\VC\bin\x86_amd64" -I"E:\google\caffe-master\NugetPackages\OpenCV.2.4.11\build\native../../build/native/include/" -I"E:\google\caffe-master\NugetPackages\lmdb-v120-clean.0.9.14.0\build\native....\lib\native\include" -I"E:\google\caffe-master\NugetPackages\LevelDB-vc120.1.2.0.0\build\native../..//build/native/include/" -I"E:\google\caffe-master\NugetPackages\protobuf-v120.2.6.1\build\native../..//build/native/include/" -I"E:\google\caffe-master\NugetPackages\glog.0.3.3.0\build\native../..//build/native/include/" -I"E:\google\caffe-master\NugetPackages\gflags.2.1.2.1\build\native../..///build/native/include/" -I"E:\google\caffe-master\NugetPackages\boost.1.59.0.0\build\native....\lib\native\include\" -I"E:\google\caffe-master\NugetPackages\hdf5-v120-complete.1.8.15.2\build\native....\lib\native\include" -I"E:\google\caffe-master\NugetPackages\OpenBLAS.0.2.14.1\build\native....\lib\native\include" -I"E:\google\caffe-master\caffe-master\windows\libcaffe\....\src\" -I..........\cuda\GPU\CUDA\v8.0\include -I..........\cuda\GPU\CUDA\v8.0\include --keep-dir E:\google\caffe-master\caffe-master\windows..\Build\Int\libcaffe\x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -Xcudafe "--diag_suppress=exception_spec_override_incompat --diag_suppress=useless_using_declaration --diag_suppress=field_without_dll_interface" -D_SCL_SECURE_NO_WARNINGS -DGFLAGS_DLL_DECL= -DHAS_OPENCV -DHAS_LMDB -DHAS_HDF5 -DHAS_OPENBLAS -DNDEBUG -D_SCL_SECURE_NO_WARNINGS -DUSE_OPENCV -DUSE_LEVELDB -DUSE_LMDB -DWITH_PYTHON_LAYER -DBOOST_PYTHON_STATIC_LIB -DUSE_CUDNN -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W1 /nologo /Ox /FS /Zi /MD " -o E:\google\caffe-master\caffe-master\windows..\Build\Int\libcaffe\x64\Release\im2col_layer.cu.obj "E:\google\caffe-master\caffe-master\src\caffe\layers\im2col_layer.cu"”已退出,返回代码为 2。 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 8.0.targets 687 9 libcaffe