0

I am trying openCV+Yolo3. I am using Mac with this config:

  • MacBook Pro (Retina, 15-inch, Mid - 2015)
  • Graphics Intel Iris Pro 1536 MB

Update - OS info:

  • macOS Catalina version 10.15.2

I checked Apple website and it says this MacBook supports openCL 1.2: https://support.apple.com/en-ca/HT202823

My program uses opencv-contrib-python 4.1.2. And the code snippet is:

net = cv2.dnn.readNetFromDarknet(model_configuration, model_weights) 
net.setPreferableBackend(cv2.dnn.DNN_BACKEND_OPENCV) 
net.setPreferableTarget(cv2.dnn.DNN_TARGET_OPENCL)

I also tried DNN_TARGET_OPENCL_FP16. BTW, I use the common pre-trained yolo3 cfg and weights and coco.names.

The problem is, my program cannot use GPU on my Mac. When I run a video through it, the inference time is 300+ ms per frame and from Activity Monitor I can see that the GPU usage is 0.0% while CPU is 70%+. I don't know why I can't use GPU via openGL on the Mac. Is there any trick I miss?

asked Dec 19, 2019 at 20:12
3
  • From this question it looks like you can set the device settings to use the GPU explicitly device = platform.get_devices()[1]; ctx = cl.Context([device]) # Tell CL to use GPU Commented Dec 19, 2019 at 20:16
  • Thanks. I read through it but it seems it is a different problem. In openCV do we have similar APIs or we can config these when building openCV? @C.Nivs Commented Dec 19, 2019 at 20:43
  • Sorry, misread that question Commented Dec 19, 2019 at 21:53

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.