pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.73k stars 21.33k forks source link

solved: Yolov4 specific gpu for detection #2210

Open SLyra21 opened 4 years ago

SLyra21 commented 4 years ago

Hi guys,

I trained Yolov4 on a custom dataset with 2 powerful gpus. Now I would like to use a specific of the two gpus for detection, but I cannot find the code snippet where the GPU is chosen for detection. Is it inside the .so-file? Can I specify it at the beginning of my code?

I would really appreciate your help.

Best regards, Simon

SLyra21 commented 4 years ago

Hi guys,

I solved the problem myself:

you just have to add the line "lib.cuda_set_device(x)" in the detector initialization with x as your GPU id and the detector will work with the specific GPU.

Best, Simon