Ubuntu16.04安装opencv-3.4.0和opencv_contrib-3.4.0以及配置yolo V3环境GPU版
配置环境:
Ubuntu16.04
GPU: gtx1060 6g
opencv-3.4.0
opencv-contrib-3.4.0
参考链接: 教程很详细
yolov3-tiny(yolov3)训练自己的数据集(一):DarkNet + Ubuntu16.04 + GPU + OpenCV3.4.0 配置篇
配出过程报错以及很难通过官网下载的资源:
1.cudnn下载官网下载很慢
2.OpenCV-3.4.0以及下载opencv_contrib-3.4.0下载不完全等各种问题,下载文件尽量不要下载zip,在Ubuntu下最好下载tar.gz
3.在进行cmake-gui的gennerate源码编译时候,提示IPPICV: Download: ippicv_2017u3_lnx_intel64_general_20170822.tgz 下载超时
解决办法:将文件提前下载,并在ippicv.cmake文件夹下找到下载的github网址,将其替换为下载保存的文件的路径
参考链接:安装opencv时下载ippicv报错
ubuntu下安装opencv3.2出现-- ICV: Downloading ippicv_linux_20151201.tgz…
4在进行cmake-gui的generate的时候,xfeatures2d模块缺失boostdesc_bgm.i文件等下载超时的问题
解决办法参考链接:安装opencv时,xfeatures2d模块缺失boostdesc_bgm.i文件,下载超时问题
5.在进行make-j4编译安装的时候虽然不显示报错,但是重复了几次类似于下面这种:
from /home/agent/opencv-3.4.5/modules/cudaoptflow/src/cuda/pyrlk.cu:47:
/usr/local/cuda-10.0/include/device_functions.h:54:2: warning: #warning "device_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]
#warning "device_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."
^~~~~~~
In file included from /home/agent/opencv-3.4.5/modules/core/include/opencv2/core/cuda/functional.hpp:50:0,
from /home/agent/opencv-3.4.5/modules/cudaoptflow/src/cuda/pyrlk.cu:47:
/usr/local/cuda-10.0/include/device_functions.h:54:2: warning: #warning "device_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]
#warning "device_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."
^~~~~~~
In file included from /home/agent/opencv-3.4.5/modules/core/include/opencv2/core/cuda/functional.hpp:50:0,
from /home/agent/opencv-3.4.5/modules/cudaoptflow/src/cuda/pyrlk.cu:47:
/usr/local/cuda-10.0/include/device_functions.h:54:2: warning: #warning "device_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]
#warning "device_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."
解决办法:忽略,静静等待即可,过一会也可以编译完成。
可以参考链接:jetson nano编译安装opencv3.4.5+opencv_contrib-3.4.5时,能通过编译,但是安装时报错,错误信息如下:
的评论中也有提到。
6.配置成功后,运行测试报错:测试yolov3时报错:cuda error: out of memory darknet: ./src/cuda.c:36: check_error: Assertion `0’ failed.
参考链接:https://blog.csdn.net/kevineeo/article/details/84572589?spm=1001.2014.3001.5501
7.进行视频检测的时候,报错:
Couldn't connect to webcam.
: No such file or directory
darknet: ./src/utils.c:256: error: Assertion `0' failed.
Aborted (core dumped)
解决方法:可能是视频的分辨率太大,调整视频分辨率之后,再进行检测成功。
最后简单源码安装opencv的方法,但注意的是没有安装opencv-3.4.0-contrib,以及默认的安装路径。
ubuntu16.04 +opencv3.2.0安装笔记+Downloading ippicv_linux_20151201.tgz