Project 4c - YOLOv4 with CUDA support
- James Canova
- Sep 10, 2021
- 1 min read
Project start: 30 December 2021
Project finish: 1 January 2022
Objective: Installation of YOLO4 with CUDA support in VEnv
Yolo is a definition of a convolutional neural network which I believe has 106 layers.
Weights are calculated, i.e., the Yolo neural network is trained, using a program called Darknet. It is not a Python module but is a command line operation. Results are saved in a .weights file.
A .cfg file and .weights file are required to make use of the Yolo network. A .names file is also required. These will be explained later.
OpenCV reads these files for detection of objects.
Software installation:
add to .bashrc (located in HOME directory):
"/usr/local/cuda-10.2/bin:$PATH" (added to existing export path)
export LD_LIBRARY_PATH="/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH"
close and open new terminal and check that nvcc is working:
nvcc -V
outside VEnv:
sudo apt-get update
sudo apt-get upgrade
clone the latest Darknet code for YOLO4 with CUDA support from GitHub:
(ref: https://jkjung-avt.github.io/yolov4/)
cd $HOME
cd Public/Projects/
change to the VEnv directory but do not activate it:
cd Public/Projects/myPython36VEnv
$ git clone https://github.com/AlexeyAB/darknet.git
$ cd darknet
vim Makefile:
Set the values: GPU=1 CUDNN=1
CUDNN_HALF=1 OPENCV=1
ARCH= -gencode arch=compute_53,code=[sm_53,compute_53]
make clean
make -j4 (takes about 1 minute)
If you have any problems or need clarification please contact me: jscanova@gmail.com
Comments