WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 572 forks source link

How to run inference with CPU only? #259

Open huyhoangle86 opened 3 years ago

huyhoangle86 commented 3 years ago

Hi, in detect.py I tried to set argument in --device = cpu to run only by CPU, but when I check the GPU status it still uses more than 1GB of my GPU as in the pic below . What happened ? How can I inference only on CPU? I did try to delve into the code but no luck image

I'm using ScaledYOLOv4 CSP version

huyhoangle86 commented 3 years ago

@WongKinYiu please help

WongKinYiu commented 3 years ago

i have not used cpu for inference.

https://github.com/WongKinYiu/ScaledYOLOv4/blob/yolov4-csp/detect.py#L43 try to change .cuda() to .cpu()

huyhoangle86 commented 3 years ago

@WongKinYiu No, I tried but it's not working still use >1GB of GPU lol