TensorFlow-2.x-YOLOv3 icon indicating copy to clipboard operation
TensorFlow-2.x-YOLOv3 copied to clipboard

Running Yolo.predict(image_data) on GPU works once only

Open DomFo opened this issue 4 years ago • 5 comments

Hi, thanks a lot for this repo and your tutorials!

I encountered that when I run the detection_demo.py on multiple images (or the realtime webcam video), only the first image (or frame from the video) gets predicted using Yolo.predict(image_data) when it's running on my GPU (in a docker container).

However, when I change this line to Yolo(image_data), it works for both multiple images and webcam stream.

Any idea why that is?

DomFo avatar Jan 22 '21 23:01 DomFo

Hi, actually I am not sure, for me, it works just fine.

pythonlessons avatar Feb 01 '21 07:02 pythonlessons

I am getting the same issue when streaming a video in realtime, and found that this only happens when I am using GPU, but works fine when I am using CPU, as mentioned in #150.

I did what you said by changing Yolo.predict(image_data) to Yolo(image_data) and it works fine now. Thanks!

However, when I change this line to Yolo(image_data), it works for both multiple images and webcam stream.

Any idea why that is?

dylantzx avatar Jul 15 '21 06:07 dylantzx

It works! thanks! It seems that with TF 2.3 both option works, but from TF >=2.4 only works with the call Yolo(image_data).

hernancontigiani avatar Aug 06 '21 13:08 hernancontigiani

You guys just saved my day!!! I was debugging since yesterday! It must be Yolo(image_data)!

I use this incredible yolo implementation on NVIDIA Jetson within Docker with TensorFlow 2.8, and yes, Thanks for the solution! And how did you find out?

Shout out to @pythonlessons, you did a great job! Thanks for sharing.

dnzlr avatar Jul 13 '22 22:07 dnzlr

You guys just saved my day!!! I was debugging since yesterday! It must be Yolo(image_data)!

I use this incredible yolo implementation on NVIDIA Jetson within Docker with TensorFlow 2.8, and yes, Thanks for the solution! And how did you find out?

Shout out to @pythonlessons, you did a great job! Thanks for sharing.

Hey, thanks, in this project there is a lot that could be improved, but that requires a lot of time and effort. Hope in the future I could do some similar project with newest yolo versions!

pythonlessons avatar Jul 14 '22 07:07 pythonlessons