最近编译caffe报错,我的cudnn版本(cuDNN : ver. 7.0.5),然后caffe中cudnn版本太低,出现的错误:
CMake Error at cuda_compile_1_generated_bias_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_bias_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:2573:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bias_layer.cu.o] 错误 1
make[2]: *** 正在等待未完成的任务....
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
1 error detected in the compilation of "/tmp/tmpxft_00007e65_00000000-4_batch_reindex_layer.cpp4.ii".
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
CMake Error at cuda_compile_1_generated_batch_reindex_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_batch_reindex_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:2071:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_reindex_layer.cu.o] 错误 1
1 error detected in the compilation of "/tmp/tmpxft_00007e75_00000000-4_absval_layer.cpp4.ii".
CMake Error at cuda_compile_1_generated_absval_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_absval_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:560:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_absval_layer.cu.o] 错误 1
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
1 error detected in the compilation of "/tmp/tmpxft_00007e90_00000000-4_contrastive_loss_layer.cpp4.ii".
CMake Error at cuda_compile_1_generated_contrastive_loss_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_contrastive_loss_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:3583:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_contrastive_loss_layer.cu.o] 错误 1
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
1 error detected in the compilation of "/tmp/tmpxft_00007e88_00000000-4_batch_norm_layer.cpp4.ii".
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
CMake Error at cuda_compile_1_generated_batch_norm_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_batch_norm_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:1570:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_batch_norm_layer.cu.o] 错误 1
1 error detected in the compilation of "/tmp/tmpxft_00007e73_00000000-4_base_data_layer.cpp4.ii".
CMake Error at cuda_compile_1_generated_base_data_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_base_data_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:1069:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_base_data_layer.cu.o] 错误 1
1 error detected in the compilation of "/tmp/tmpxft_00007e5f_00000000-4_bnll_layer.cpp4.ii".
CMake Error at cuda_compile_1_generated_bnll_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_bnll_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:3075:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_bnll_layer.cu.o] 错误 1
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/include/caffe/util/cudnn.hpp(112): error: too few arguments in function call
1 error detected in the compilation of "/tmp/tmpxft_00007e81_00000000-4_concat_layer.cpp4.ii".
CMake Error at cuda_compile_1_generated_concat_layer.cu.o.Release.cmake:279 (message):
Error generating file
/home/fuxueping/sdb/Caffe_Project_Train/caffe-yolo9000_k_means_Region_box/build/src/caffe/CMakeFiles/cuda_compile_1.dir/layers/./cuda_compile_1_generated_concat_layer.cu.o
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:3576:src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_concat_layer.cu.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:235:src/caffe/CMakeFiles/caffe.dir/all] 错误 2
解决办法:
将:
template <typename Dtype>
inline void setConvolutionDesc(cudnnConvolutionDescriptor_t* conv,
cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter,
int pad_h, int pad_w, int stride_h, int stride_w) {
CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
}
修改为:
template <typename Dtype>
inline void setConvolutionDesc(cudnnConvolutionDescriptor_t* conv,
cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter,
int pad_h, int pad_w, int stride_h, int stride_w) {
//CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
//pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
#if CUDNN_VERSION_MIN(6, 0, 0)
CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION,
dataType<Dtype>::type));
#else
CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
#endif
}
转载:https://blog.csdn.net/mao_hui_fei/article/details/80326464