安装darknet版yolov3

下载Darknet源码:
git clone https://github.com/AlexeyAB/darknet.git
cd darknet

修改Makefile:
GPU=1
CUDNN=1
OPENCV=1
LIBSO=1

在/etc/ld.so.conf.d 创建一个cuda.conf 文件
sudo vim /etc/ld.so.conf.d/cuda.conf
写入/usr/local/cuda/lib64
执行:sudo ldconfig 使文件生效

编译源码:
make
验证darknet:
输入./darknet
正常输出usage: ./darknet

踩坑记录:
编译报错Makefile:185: recipe for target ‘obj/network-kernels.o’ failed
##此错误大抵发生在cuda10.0##
解决办法:
1、打开network_kernels.cu,使用快捷键ctrl+F查找关键词cudaStreamCaptureModeGlobal,该文档下只有这一处,将这一参数删除并保存。(注意这个参数前面的是逗号也要删掉。)
2.在终端输入 make clean
3.make

编译报错Makefile:182: recipe for target ‘obj/image_opencv.o’ failed
解决办法:
apt-get install libopencv-dev
若报错 Unable to locate package libopencv-dev
若不报错直接make clean再make
cd /etc/apt
vim sources.list
将以下内容复制进sources.list文件:

# deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/INSTALL $

# deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot i386 LIVE/INSTALL $

## Security updates

deb http://http.kali.org/ /kali main contrib non-free

deb http://http.kali.org/ /wheezy main contrib non-free

deb http://http.kali.org/kali kali-dev main contrib non-free

deb http://http.kali.org/kali kali-dev main/debian-installer

deb-src http://http.kali.org/kali kali-dev main contrib non-free

deb http://http.kali.org/kali kali main contrib non-free

deb http://http.kali.org/kali kali main/debian-installer

deb-src http://http.kali.org/kali kali main contrib non-free

deb http://security.kali.org/kali-security kali/updates main contrib non-free

deb-src http://security.kali.org/kali-security kali/updates main contrib non-fr$

apt-get update
apt-get install libopencv-dev
make clean
make

你可能感兴趣的:(深度学习,人工智能,计算机视觉)