A Docker image containing all the dependencies you need to run yolov4 with GPUs.
中文教學(full Tutorial):https://hackmd.io/@neverleave0916/YOLOv4 (可跳過安裝環境,由 3.測試YOLOv4 開始實作)
Last updated: 2022/2/1 17:52
-
This Repository installs all the Dependencies that you need to run yolov4 with GPUs on your machine.
-
This Docker image is based on nvcr.io/nvidia/pytorch:20.03-py3 (we won't use PyTorch)
-
You should have CUDA installed on the machine
Software | Version | Version |
---|---|---|
Ubuntu | 18.04 | 20.04 |
Docker | 19.03.8 | 20.10.5 |
Nvidia Driver | 440.82 | 450.102 |
CUDA | 10.2 | 11.0 |
You may use the
latest
orauto
tag to specify the image you need.
latest
is the original image that I generated manually. (2020.07 build notes)
auto
is the image that automatic build from this DockerFile. (2022.02)
auto
image does not contain VNC server- Except for the package version, there is no difference between the two images. If you can't run Yolo on one, you may try another one.
docker run --gpus all --ipc=host -it -p 8888:8888 -p 5901:5901 neverleave0916/yolo_v4:auto
- port 8888: jupyter
- port 5901: VNC(if installed)
git clone https://github.com/AlexeyAB/darknet
chmod -R 777 darknet/ #This step is important
you can follow the AlexeyAB/darknet tutorial if you want, below are the steps that I use, because I kept getting errors in the AlexeyAB/darknet tutorial
- Open Makefile
cd darknet
vim Makefile
- Modify these param to train with GPU and display image
You may need to follow the newest instruction in the original yolov4 GitHub.
GPU=1
CUDNN=1
CUDNN_HALF=1
OPENCV=1
AVX=0
OPENMP=0
LIBSO=1
ZED_CAMERA=0 # ZED SDK 3.0 and above
ZED_CAMERA_v2_8=0 # ZED SDK 2.X
- Compile
make
- get the pre-train weights
wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
- testing YOLOv4(on single Image) caution :If there are GUI env on your computer,you could remove -dont_show to display the image.
./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/person.jpg -i 0 -thresh 0.25 -dont_show
- View the result
If succeed, you will get predictions.jpg in your folder.