Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)

安装方式一下博客很详细,只是是把8改成9,6改成7的问题

https://blog.csdn.net/qq_38522972/article/details/83504641

cudnn7 for cuda9.0:

https://download.csdn.net/download/qq_38522972/10795301

下面主要说说caffe编译问题,以上博客很详细,单有一点和与cuda8.0的不同:

还需要修改akefile.config文件!

Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第1张图片

改为:

Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第2张图片 

 如果不修改这个会出现如下错误:

Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第3张图片

nvcc fatal   :Unsupported gpu architecture 'compute_20'

 

常见问题问题分析1:

/usr/bin/ld:cannot find -lcudnn

collect2: error: ld returned 1 exit status

Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第4张图片 

解决方案:肯定是cudnn没配好,仔细查对配置caffe中cudnn这个模块!!!!

https://blog.csdn.net/qq_38522972/article/details/83504641

Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第5张图片 

 常见问题问题分析2:

.build_release/lib/libcaffe-nv.so: undefined reference to cv::imread(cv::String const&, int)' 

.build_release/lib/libcaffe-nv.so: undefined reference tocv::imencode(cv::String const&, cv::_InputArray const&, 
std::vector >&, std::vector > const&)'
.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第6张图片

 解决方案:修改 Makefile文件:

Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3)_第7张图片

在这行后面加:opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs 

再次make clean

make -j8 

编译

 

你可能感兴趣的:(Ubuntu16.04 caffe (cuda9.0,cudnn7 opencv3.3))