系统配置仍为CUDA9.0 CUDNN9.0 (可在本人文章管理中查询) opencv3.41 用系统本身的python 配置Faster Rcnn

5.安装opencv3.4.1

安装之前需要安装cmake

安装cmake: sudo apt-get install cmake

1.下载opencv

下载地址:https://github.com/opencv/opencv

2.下载之后解压安装包

解压:unzip opencv-3.4.1.zip

3.在当前目录下创建一个新文件夹用于编译opencv

创建文件夹:mkdir opencv3.4_build

4.进入刚刚创建的文件夹里面

进入文件夹:cd opencv_build

5.编译opencv ,如果没有安装cuda,用命令1进行cmake,如果需要支持cuda加速,用命令2进行cmake

编译:

5.1  没有安装cuda可以不开cuda进行cmake

cmake ../opencv-3.4.1 -DWITH_GTK_2_X=ON -DCMAKE_INSTALL_PREFIX=/usr/local

5.2    安装了cuda可以使用支持cuda加速命令进行cmake(可以直接复制)

cmake  ../opencv-3.4.1 -DWITH_GTK_2_X=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON  -DWITH_OPENGL=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DWITH_OPENMP=ON

 

编译opencv时碰到如下是错误:

driver_api_multi.cpp:(.text._ZNK6WorkerclEi+0x893): undefined reference to `cuCtxPopCurrent_v2'
CMakeFiles/example_gpu_driver_api_multi.dir/driver_api_multi.cpp.o: In function `main':
driver_api_multi.cpp:(.text.startup.main+0x11c): undefined reference to `cuInit'
driver_api_multi.cpp:(.text.startup.main+0x133): undefined reference to `cuDeviceGet'
driver_api_multi.cpp:(.text.startup.main+0x14d): undefined reference to `cuCtxCreate_v2'
driver_api_multi.cpp:(.text.startup.main+0x15d): undefined reference to `cuCtxPopCurrent_v2'
driver_api_multi.cpp:(.text.startup.main+0x172): undefined reference to `cuDeviceGet'
driver_api_multi.cpp:(.text.startup.main+0x18c): undefined reference to `cuCtxCreate_v2'
driver_api_multi.cpp:(.text.startup.main+0x19c): undefined reference to `cuCtxPopCurrent_v2'
collect2: error: ld returned 1 exit status
samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/build.make:125: recipe for target 'bin/example_gpu_driver_api_multi' failed
make[2]: *** [bin/example_gpu_driver_api_multi] Error 1
CMakeFiles/Makefile2:39358: recipe for target 'samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/all' failed
make[1]: *** [samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs..

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值