opencv3.1+cuda8.0+caffe报错

xiaoxiao2021-02-28  61

为让TensorFlow和caffe共存将cuda换为8.0 

在安装OpenCV时提示如下错误:

/home/usrname/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:120:54: error: 'NppiGraphcutState' has not been declared

typedef NppStatus (*init_func_t)(NppiSize oSize, NppiGraphcutState** ppStat

^

/home/usrname/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:135:18: error: 'NppiGraphcutState' does not name a type

operator NppiGraphcutState*()

^

/home/usrname/opencv-3.1.0/modules/cudalegacy/src/graphcuts.cpp:141:9: error: 'NppiGraphcutState' does not name a type

NppiGraphcutState* pState;

.......

解决办法:

进入opencv-3.1.0/modules/cudalegacy/src/目录,修改graphcuts.cpp文件,将:

#include "precomp.hpp"

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)

改为

#include "precomp.hpp"

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)

然后make编译就可以了

转载请注明原文地址: https://www.6miu.com/read-73024.html

最新回复(0)