Caffe cuDNN R1编译错误

时间:2015-05-08 15:24:09

标签: cuda caffe

我正在尝试在Ubuntu 14.04上启用cuDNN-6.5-R1来编译Caffe。 CUDA版本是7.0。

我复制了/ usr / local / cuda / include中的cudnn.h头文件和/ usr / local / cuda / lib64中的cudnn库,然后是“sudo ldconfig”,当我做“make all”时,我得到以下错误:

PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/util/db.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
             from ./include/caffe/common.hpp:19,
             from ./include/caffe/util/db.hpp:10,
             from src/caffe/util/db.cpp:1:
./include/caffe/util/cudnn.hpp:64:32: error: variable or field ‘createTensor4dDesc’ declared void
 inline void createTensor4dDesc(cudnnTensorDescriptor_t* desc) {
                            ^
./include/caffe/util/cudnn.hpp:64:32: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/util/cudnn.hpp:64:57: error: ‘desc’ was not declared in this scope
 inline void createTensor4dDesc(cudnnTensorDescriptor_t* desc) {
                                                     ^
./include/caffe/util/cudnn.hpp:69:29: error: variable or field ‘setTensor4dDesc’ declared void
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                         ^
./include/caffe/util/cudnn.hpp:69:29: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/util/cudnn.hpp:69:54: error: ‘desc’ was not declared in this scope
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                                                  ^
./include/caffe/util/cudnn.hpp:70:5: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
     ^
./include/caffe/util/cudnn.hpp:70:12: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
        ^
./include/caffe/util/cudnn.hpp:70:19: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
               ^
./include/caffe/util/cudnn.hpp:70:26: error: expected primary-expression before ‘int’
     int n, int c, int h, int w,
                      ^
./include/caffe/util/cudnn.hpp:71:5: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
     ^
./include/caffe/util/cudnn.hpp:71:19: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
               ^
./include/caffe/util/cudnn.hpp:71:33: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
                             ^
./include/caffe/util/cudnn.hpp:71:47: error: expected primary-expression before ‘int’
     int stride_n, int stride_c, int stride_h, int stride_w) {
                                           ^
./include/caffe/util/cudnn.hpp:77:29: error: variable or field ‘setTensor4dDesc’ declared void
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                         ^
./include/caffe/util/cudnn.hpp:77:29: error: ‘cudnnTensorDescriptor_t’ was not declared in this scope
./include/caffe/util/cudnn.hpp:77:54: error: ‘desc’ was not declared in this scope
 inline void setTensor4dDesc(cudnnTensorDescriptor_t* desc,
                                                  ^
./include/caffe/util/cudnn.hpp:78:5: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
     ^
./include/caffe/util/cudnn.hpp:78:12: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
        ^
./include/caffe/util/cudnn.hpp:78:19: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
               ^
./include/caffe/util/cudnn.hpp:78:26: error: expected primary-expression before ‘int’
     int n, int c, int h, int w) {
                      ^
./include/caffe/util/cudnn.hpp:102:5: error: ‘cudnnTensorDescriptor_t’ has not been declared
     cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter,
     ^
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::setConvolutionDesc(cudnnConvolutionStruct**, int, cudnnFilterDescriptor_t, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:105:70: error: there are no arguments to ‘cudnnSetConvolution2dDescriptor’ that depend on a template parameter, so a declaration of ‘cudnnSetConvolution2dDescriptor’ must be available [-fpermissive]
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
                                                                  ^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                        ^
./include/caffe/util/cudnn.hpp:105:70: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
                                                                  ^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                        ^
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:117:13: error: ‘CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING’ was not declared in this scope
     *mode = CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING;
         ^
./include/caffe/util/cudnn.hpp:124:41: error: there are no arguments to ‘cudnnSetPooling2dDescriptor’ that depend on a template parameter, so a declaration of ‘cudnnSetPooling2dDescriptor’ must be available [-fpermissive]
     pad_h, pad_w, stride_h, stride_w));
                                     ^
./include/caffe/util/cudnn.hpp:12:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                        ^
src/caffe/util/db.cpp: In function ‘caffe::db::DB* caffe::db::GetDB(caffe::DataParameter::DB)’:
src/caffe/util/db.cpp:71:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
src/caffe/util/db.cpp: In function ‘caffe::db::DB* caffe::db::GetDB(const string&)’:
src/caffe/util/db.cpp:81:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [.build_release/src/caffe/util/db.o] Error 1

我检查过与我有同样问题的人的其他帖子,但他们都使用R2,而不是R1。

1 个答案:

答案 0 :(得分:1)

有关如何安装CUDA,cuDNN和Caffe的详细说明,请查看" GPU Powered DeepLearning with NVIDIA DIGITS on EC2"。

他们之所以全部使用R2" BTW是b / c,这只是一个要求。