yongyong-e

[Darknet: YOLO] 2. Compiling With CUDA & OpenCV 본문

머신러닝/컴퓨터비전

[Darknet: YOLO] 2. Compiling With CUDA & OpenCV

Yonghan Kim 2017. 7. 25. 19:52

▶ Compiling With CUDA

CPU보다 GPU에서 500 배 빠르다고 함

따라서 Nvidia GPU와 CUDA 설치를 통해 테스트 진행 


1. Install Nvidia GPU & CUDA

참고 - 2017/07/27 - [머신러닝/TensorFlow - Models] - (ubuntu16.04) Install tensorflow-gpu


2. change the first line of the Makefile

$ vi Makefile

GPU=1


3. Run

$ make


4. Preferences

그래픽 카드 확인

$ nvidia-smi


Darknet에서 사용하는 카드를 변경하려면 다음 -i <index>과 같이 변경 가능

$ ./darknet -i 1 imagenet test cfg/alexnet.cfg alexnet.weights


다시 CPU를 사용하고 싶을 경우

$ ./darknet -nogpu imagenet test cfg/alexnet.cfg alexnet.weights


▶ Compiling With OpenCV 

1. Install OpenCV

참고 2017/09/19 - [리눅스/ubuntu] - Install OpenCV 3.2.0


2. change the 3rd line of the Makefile

$ vi Makefile

OPENCV=1


3. Run

$ make


Reference

https://pjreddie.com/darknet/install/#cuda


Comments