1、配置darknet
配置darknet
出现错误:
qhy@qhy-desktop:~/darknet$ make clean
qhy@qhy-desktop:~/darknet$ make
……
gcc -Iinclude/ -Isrc/ -DGPU -I/usr/local/cuda/include/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DGPU -c ./src/yolo_layer.c -o obj/yolo_layer.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -Iinclude/ -Isrc/ -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
/bin/sh: 1: nvcc: not found
Makefile:92: recipe for target 'obj/convolutional_kernels.o' failed
make: *** [obj/convolutional_kernels.o] Error 127
qhy@qhy-desktop:~darknet$
解决方法:
# 修改makefile
NVCC = /usr/local/cuda-10.0/bin/nvcc
并将makefile中带有cuda的路径都改为自己的cuda版本
4.1 CUDA Toolkit 8.0
CUDA Toolkit 8.0 开发环境变量设置。
qhy@qhy-desktop:~/darknet$ sudo vim /etc/profile
vim编译器中:
:wq 为保存并退出
在 /etc/profile 文件末尾添加如下环境变量。
export PATH=/usr/local/cuda-10.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
---------------------
原文:https://blog.csdn.net/qq_33869371/article/details/89260056