pythonlessons / TensorFlow-2.x-YOLOv3

YOLOv3 implementation in TensorFlow 2.3.1
https://pylessons.com/
MIT License
607 stars 327 forks source link

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

Open DomFo opened 3 years ago

DomFo commented 3 years ago

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?

pythonlessons commented 3 years ago

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

dylantzx commented 3 years ago

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?

hernancontigiani commented 3 years ago

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).

dnzlr commented 2 years ago

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.

pythonlessons commented 2 years ago

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!