安装caffe时出现“CUDNN_STATUS_VERSION_MISMATCH”错误

问题描述 投票:0回答:2

我按照http://caffe.berkeleyvision.org/installation.html的指令尝试了caffe安装,ubuntu安装命令

sudo apt install caffe-cuda
根本不起作用,出现错误

Package caffe-cuda is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'caffe-cuda' has no installation candidate

所以我遵循“使用 Make 进行编译”部分。

我解决了所有依赖问题,但最终因“CUDNN_STATUS_VERSION_MISMATCH”错误而失败,为了解决我在谷歌上搜索的错误也尝试了很多https://anidh.medium.com/install-caffe-on-ubuntu-with-cuda-6d0da9e8f860https://qengineering.eu/install-caffe-on-ubuntu-20.04-with-opencv-4.4.html,全部失败,所以我在这里寻求帮助。

我的环境

  • 操作系统:Ubuntu 20.04 LTS
  • GPU:Nvidia GeForce GTX 1080Ti
  • 驱动版本:460.56
  • CUDA版本:11.2
  • cuDNN 版本:8.1.1
  • Python版本:3.8.5
  • 康达版本:4.9.2
  • C 编译器:GNU 9.3.0

错误信息(只是make):

(base) a@ai:~/Software/caffe$ make clean
(base) a@ai:~/Software/caffe$ make all -j8
PROTOC src/caffe/proto/caffe.proto
NVCC src/caffe/util/im2col.cu
NVCC src/caffe/util/math_functions.cu
NVCC src/caffe/solvers/adam_solver.cu
NVCC src/caffe/solvers/adagrad_solver.cu
NVCC src/caffe/solvers/adadelta_solver.cu
NVCC src/caffe/solvers/nesterov_solver.cu
NVCC src/caffe/solvers/rmsprop_solver.cu
NVCC src/caffe/solvers/sgd_solver.cu
In file included from src/caffe/util/math_functions.cu:1:
/usr/local/cuda/include/math_functions.h:54:2: warning: #warning "math_functions.h is an internal header file and must not be used directly.  This file will be removed in a future CUDA release.  Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]
   54 | #warning "math_functions.h is an internal header file and must not be used directly.  This file will be removed in a future CUDA release.  Please use cuda_runtime_api.h or cuda_runtime.h instead."
      |  ^~~~~~~
NVCC src/caffe/layers/absval_layer.cu
NVCC src/caffe/layers/pooling_layer.cu
     .
     .
     all success
     .
     .
     .
CXX tools/caffe.cpp
CXX tools/compute_image_mean.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/util/db.hpp:6,
                 from tools/compute_image_mean.cpp:12:
./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   21 |   switch (status) {
     .
     .
     all failed with same error
     .
     .
     .
CXX src/caffe/data_transformer.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40,
                 from ./include/caffe/common.hpp:19,
                 from src/caffe/util/io.cpp:18:
./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   21 |   switch (status) {
      |          ^
src/caffe/util/io.cpp: In function ‘cv::Mat caffe::ReadImageToCVMat(const string&, int, int, bool)’:
src/caffe/util/io.cpp:76:34: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
   76 |   int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
      |                                  ^~~~~~~~~~~~~~~~~~~
src/caffe/util/io.cpp:77:5: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
   77 |     CV_LOAD_IMAGE_GRAYSCALE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
src/caffe/util/io.cpp: In function ‘cv::Mat caffe::DecodeDatumToCVMat(const caffe::Datum&, bool)’:
src/caffe/util/io.cpp:182:34: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
  182 |   int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
      |                                  ^~~~~~~~~~~~~~~~~~~
src/caffe/util/io.cpp:183:5: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
  183 |     CV_LOAD_IMAGE_GRAYSCALE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:592: .build_release/src/caffe/util/io.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./include/caffe/util/device_alternate.hpp:40,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/util/db.hpp:6,
                 from ./include/caffe/util/db_lmdb.hpp:10,
                 from src/caffe/util/db_lmdb.cpp:2:
./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   21 |   switch (status) {
      |          ^
     .
     .
     all failed with same error
     .
     .
     .
In file included from ./include/caffe/util/device_alternate.hpp:40,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/data_transformer.hpp:6,
                 from src/caffe/data_transformer.cpp:8:
./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   21 |   switch (status) {
      |          ^

另一个错误消息(cmake 然后 make):

(base) a@ai:~/Software/caffe$ mkdir build
(base) a@ai:~/Software/caffe$ cd build/
(base) a@ai:~/Software/caffe/build$ cmake ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at cmake/Misc.cmake:32 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
Call Stack (most recent call first):
  CMakeLists.txt:25 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.54") found components: system thread filesystem 
-- Found Threads: TRUE  
-- Found GFlags: /usr/include  
-- Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found Glog: /usr/include  
-- Found glog    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread (found version "3.6.1") 
-- Found PROTOBUF Compiler: /usr/bin/protoc
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- HDF5: Using hdf5 compiler wrapper to determine CXX configuration
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.so;/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.10.4") found components: HL 
-- Found LMDB: /usr/include  
-- Found lmdb    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)
-- Found LevelDB: /usr/include  
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)
-- Found Snappy: /usr/include  
-- Found Snappy  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)
-- CUDA detected: 11.2
-- Found cuDNN: ver. 8.1.1 found (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Added CUDA NVCC flags for: sm_61
-- OpenCV found (/usr/lib/x86_64-linux-gnu/cmake/opencv4)
-- Found Atlas: /usr/include/x86_64-linux-gnu  
-- Found Atlas (include: /usr/include/x86_64-linux-gnu library: /usr/lib/x86_64-linux-gnu/libatlas.so lapack: /usr/lib/x86_64-linux-gnu/liblapack.so
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.18", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.18", minimum required is "2.7") 
-- Found NumPy: /usr/lib/python2.7/dist-packages/numpy/core/include (found suitable version "1.16.5", minimum required is "1.7.1") 
-- NumPy ver. 1.16.5 found (include: /usr/lib/python2.7/dist-packages/numpy/core/include)
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.46") found components: python 
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.17") found components: doxygen missing components: dot
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- 
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   unknown
--   System            :   Linux
--   C++ compiler      :   /usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Debug CXX flags   :   -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   OFF
--   BUILD_docs        :   ON
--   CPU_ONLY          :   OFF
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   OFF
--   ALLOW_LMDB_NOLOCK :   OFF
--   USE_HDF5          :   ON
-- 
-- Dependencies:
--   BLAS              :   Yes (Atlas)
--   Boost             :   Yes (ver. 1.71)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.6.1)
--   lmdb              :   Yes (ver. 0.9.24)
--   LevelDB           :   Yes (ver. 1.22)
--   Snappy            :   Yes (ver. 1.1.8)
--   OpenCV            :   Yes (ver. 4.2.0)
--   CUDA              :   Yes (ver. 11.2)
-- 
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_61
--   cuDNN             :   Yes (ver. 8.1.1)
-- 
-- Python:
--   Interpreter       :   /usr/bin/python2.7 (ver. 2.7.18)
--   Libraries         :   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.18)
--   NumPy             :   /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.16.5)
-- 
-- Documentaion:
--   Doxygen           :   /usr/bin/doxygen (1.8.17)
--   config_file       :   /home/a/Software/caffe/.Doxyfile
-- 
-- Install:
--   Install path      :   /home/a/Software/caffe/build/install
-- 
-- Configuring done
CMake Warning at src/caffe/CMakeLists.txt:23 (add_library):
  Cannot generate a safe runtime search path for target caffe because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libcudnn.so.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/cuda-11.2/lib64

  Some of these libraries may not be found correctly.

CMake Warning at python/CMakeLists.txt:8 (add_library):
  Cannot generate a safe runtime search path for target pycaffe because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libcudnn.so.8] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/cuda-11.2/lib64

  Some of these libraries may not be found correctly.


-- Generating done
-- Build files have been written to: /home/a/Software/caffe/build
(base) a@ai:~/Software/caffe/build$ make all
[  1%] Running C++/Python protocol buffer compiler on /home/a/Software/caffe/src/caffe/proto/caffe.proto
Scanning dependencies of target caffeproto
[  1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o
[  1%] Linking CXX static library ../../lib/libcaffeproto.a
[  1%] Built target caffeproto
[  1%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o
In file included from /home/a/Software/caffe/src/caffe/util/math_functions.cu:1:
/usr/local/cuda-11.2/include/math_functions.h:54:2: warning: #warning "math_functions.h is an internal header file and must not be used directly.  This file will be removed in a future CUDA release.  Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]
/home/a/Software/caffe/include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:21:8: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   21 |   switch (status) {
      |        ^
[  1%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/layers/cuda_compile_1_generated_absval_layer.cu.o
/home/a/Software/caffe/include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:21:8: warning: enumeration value ‘CUDNN_STATUS_VERSION_MISMATCH’ not handled in switch [-Wswitch]
   
            .
     .
     dozens of same error
     .
     .
     .
   21 |   switch (status) {
      |          ^
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp: In member function ‘virtual void caffe::CuDNNConvolutionLayer<Dtype>::Reshape(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&)’:
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:136:7: error: ‘CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT’ was not declared in this scope
  136 |       CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT,
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:131:17: error: there are no arguments to ‘cudnnGetConvolutionForwardAlgorithm’ that depend on a template parameter, so a declaration of ‘cudnnGetConvolutionForwardAlgorithm’ must be available [-fpermissive]
  131 |     CUDNN_CHECK(cudnnGetConvolutionForwardAlgorithm(handle_[0],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:131:17: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
  131 |     CUDNN_CHECK(cudnnGetConvolutionForwardAlgorithm(handle_[0],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:151:11: error: ‘CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT’ was not declared in this scope
  151 |           CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT,
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:149:17: error: there are no arguments to ‘cudnnGetConvolutionBackwardFilterAlgorithm’ that depend on a template parameter, so a declaration of ‘cudnnGetConvolutionBackwardFilterAlgorithm’ must be available [-fpermissive]
  149 |     CUDNN_CHECK(cudnnGetConvolutionBackwardFilterAlgorithm(handle_[0],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:162:11: error: ‘CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT’ was not declared in this scope
  162 |           CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT,
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:160:17: error: there are no arguments to ‘cudnnGetConvolutionBackwardDataAlgorithm’ that depend on a template parameter, so a declaration of ‘cudnnGetConvolutionBackwardDataAlgorithm’ must be available [-fpermissive]
  160 |     CUDNN_CHECK(cudnnGetConvolutionBackwardDataAlgorithm(handle_[0],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp: In instantiation of ‘void caffe::CuDNNConvolutionLayer<Dtype>::Reshape(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = float]’:
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:266:1:   required from here
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:131:52: error: ‘cudnnGetConvolutionForwardAlgorithm’ was not declared in this scope; did you mean ‘cudnnGetConvolutionForwardAlgorithm_v7’?
  131 |     CUDNN_CHECK(cudnnGetConvolutionForwardAlgorithm(handle_[0],
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
  132 |       bottom_descs_[i],
      |       ~~~~~~~~~~~~~~~~~                             
  133 |       filter_desc_,
      |       ~~~~~~~~~~~~~                                 
  134 |       conv_descs_[i],
      |       ~~~~~~~~~~~~~~~                               
  135 |       top_descs_[i],
      |       ~~~~~~~~~~~~~~                                
  136 |       CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137 |       workspace_limit_bytes,
      |       ~~~~~~~~~~~~~~~~~~~~~~                        
  138 |       &fwd_algo_[i]));
      |       ~~~~~~~~~~~~~~                                
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:149:59: error: ‘cudnnGetConvolutionBackwardFilterAlgorithm’ was not declared in this scope; did you mean ‘cudnnGetConvolutionBackwardFilterAlgorithm_v7’?
  149 |     CUDNN_CHECK(cudnnGetConvolutionBackwardFilterAlgorithm(handle_[0],
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
  150 |           bottom_descs_[i], top_descs_[i], conv_descs_[i], filter_desc_,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151 |           CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  152 |           workspace_limit_bytes, &bwd_filter_algo_[i]) );
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:160:57: error: ‘cudnnGetConvolutionBackwardDataAlgorithm’ was not declared in this scope; did you mean ‘cudnnGetConvolutionBackwardDataAlgorithm_v7’?
  160 |     CUDNN_CHECK(cudnnGetConvolutionBackwardDataAlgorithm(handle_[0],
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
  161 |           filter_desc_, top_descs_[i], conv_descs_[i], bottom_descs_[i],
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  162 |           CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  163 |         workspace_limit_bytes, &bwd_data_algo_[i]));
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp: In instantiation of ‘void caffe::CuDNNConvolutionLayer<Dtype>::Reshape(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = double]’:
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:266:1:   required from here
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:131:52: error: ‘cudnnGetConvolutionForwardAlgorithm’ was not declared in this scope; did you mean ‘cudnnGetConvolutionForwardAlgorithm_v7’?
  131 |     CUDNN_CHECK(cudnnGetConvolutionForwardAlgorithm(handle_[0],
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
  132 |       bottom_descs_[i],
      |       ~~~~~~~~~~~~~~~~~                             
  133 |       filter_desc_,
      |       ~~~~~~~~~~~~~                                 
  134 |       conv_descs_[i],
      |       ~~~~~~~~~~~~~~~                               
  135 |       top_descs_[i],
      |       ~~~~~~~~~~~~~~                                
  136 |       CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT,
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  137 |       workspace_limit_bytes,
      |       ~~~~~~~~~~~~~~~~~~~~~~                        
  138 |       &fwd_algo_[i]));
      |       ~~~~~~~~~~~~~~                                
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:149:59: error: ‘cudnnGetConvolutionBackwardFilterAlgorithm’ was not declared in this scope; did you mean ‘cudnnGetConvolutionBackwardFilterAlgorithm_v7’?
  149 |     CUDNN_CHECK(cudnnGetConvolutionBackwardFilterAlgorithm(handle_[0],
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
  150 |           bottom_descs_[i], top_descs_[i], conv_descs_[i], filter_desc_,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151 |           CUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  152 |           workspace_limit_bytes, &bwd_filter_algo_[i]) );
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
/home/a/Software/caffe/src/caffe/layers/cudnn_conv_layer.cpp:160:57: error: ‘cudnnGetConvolutionBackwardDataAlgorithm’ was not declared in this scope; did you mean ‘cudnnGetConvolutionBackwardDataAlgorithm_v7’?
  160 |     CUDNN_CHECK(cudnnGetConvolutionBackwardDataAlgorithm(handle_[0],
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
  161 |           filter_desc_, top_descs_[i], conv_descs_[i], bottom_descs_[i],
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  162 |           CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  163 |         workspace_limit_bytes, &bwd_data_algo_[i]));
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
/home/a/Software/caffe/include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
   15 |     cudnnStatus_t status = condition; \
      |                            ^~~~~~~~~
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:764: src/caffe/CMakeFiles/caffe.dir/layers/cudnn_conv_layer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:401: src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
(base) a@ai:~/Software/caffe/build$ cd ..
ubuntu caffe cudnn
2个回答
0
投票

我按照此处的说明进行操作,并能够将

openpose
安装在
caffe
之上。特别是,我将 g++ 降级到 3.8。我还安装了
cuda-toolkit-11-3
Ubuntu 软件包。


0
投票

你解决了吗?为此该怎么办呢?谢谢!

© www.soinside.com 2019 - 2024. All rights reserved.