darknet编译出现的问题

darknet的git: https://github.com/pjreddie/darknet/tree/master
一般训练和图片的推测, 只需要编译 cuda, cudnn 就可以了。
但是在使用 opencv的时候,对应的 cuda版本会有问题。
opencv3.4.0 和cuda9 以下 可以正常编译。

问题1. cuda版本与opencv版本冲突

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
https://blog.csdn.net/dlphay/article/details/79502918
cuda10 版本,编译opencv2, opencv3 版本出现问题,解决比较麻烦。 opencv4可以正常编译
缺少库:
opencv_dep_CUDA_cufft_LIBRARY

一些编译opencv的链接参考:

ubuntu 16.04下安装使用OpenCV2.4.13(动态库.so
https://blog.csdn.net/woainishifu/article/details/77449373
OpenCV3.3+CUDA9.0+Cmake3.9 环境搭建
https://blog.csdn.net/u014613745/article/details/78310916
Ubuntu16.04下编译OpenCV2.4.13静态库(.a文件)
https://blog.csdn.net/woainishifu/article/details/79712110

问题2. opencv版本与darknet 的C编译器冲突

使用版本opencv4 的时候,编译darknet
解决方法:降低版本, 或者 OPENCV=0

gcc编译出错,OpenCV 4.x+ requires enabled C++11 support compilation darknet fatal error

g++编译的话 code中的C代码也会报错 ./src/gemm.c :error: invalid conversion from 'void*' to 'float*' [-fpermissive]

Test that with this , and you should see ,if not then need to install a newer version of gcc.

g++ -dM -E -x c++ -std=c++11 /dev/null | grep plus 
#define __cplusplus 201103L,

This is C API bug in OpenCV 3.4.1
Darknet with OpenCV <= 3.4.0 works well.

参考

https://stackoverflow.com/questions/49943161/opencv-4-x-requires-enabled-c11-support-compilation-darknet-fatal-error
compile opencv with darknet wrong #691
https://github.com/pjreddie/darknet/issues/691

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值