tensorflow-yolo3 icon indicating copy to clipboard operation
tensorflow-yolo3 copied to clipboard

What about the performance of tensorflow-yolov3

Open JSnobody opened this issue 6 years ago • 16 comments

Hi, I have a problem. I used a single GTX 1080TI to run. Then I followed the steps you said, and tested the image named dog,jpg. But, I found the time of predicting was a few seconds, while darknet was just about 22 ms. Is there anything wrong with my operation? And what is the performance you think? Thanks very much!

JSnobody avatar Aug 31 '18 03:08 JSnobody

@JSnobody hello, load the yolov3.weights will cost a lot time, if you restore the check point will be better. and the performance of tensorflow is slower than darknet

aloyschen avatar Aug 31 '18 04:08 aloyschen

@aloyschen Hi, yes, I know that load network and weights will cost a lot of time. I just try to test the predicting time. And I tested the time of functions as 'model.yolo_inference' and 'self.eval'. They used a few seconds. I think it need to be further optimized. Do you think so? Need some help from you! Thanks a lot!

JSnobody avatar Aug 31 '18 06:08 JSnobody

@JSnobody hello, I have test the time on Tesla M40, and the first image cost a lot time, then the next will be fast, I don't know the reason, the reason may be caused by tensorflow. you can also try detect many images in a loop Found 3 boxes for img
dog 0.99 (128, 224) (314, 537)
truck 0.91 (475, 85) (689, 170)
bicycle 0.99 (162, 119) (565, 441)
image: ./dog.jpg cost time: 4.416236400604248 second
Found 1 boxes for img
dog 1.00 (180, 239) (877, 643)
image: ./test.jpg cost time: 0.09656620025634766 second

aloyschen avatar Aug 31 '18 07:08 aloyschen

@aloyschen hello, thanks for your reply!

JSnobody avatar Aug 31 '18 09:08 JSnobody

@aloyschen By the way, I want to train COCO dataset on the project, tensorflow-yolo3. For training, will it be slower than darknet? Could you share your experience of training on it? THANK YOU!

JSnobody avatar Aug 31 '18 09:08 JSnobody

hi @aloyschen ,how about the mAP of your code.

DW1HH avatar Sep 01 '18 13:09 DW1HH

@aloyschen @DW1HH can we communicate by mail? My address is [email protected]. Thanks!

JSnobody avatar Sep 03 '18 02:09 JSnobody

@JSnobody hi, the training speed depend on GPU, I test training on M40, batch size is 10, one iteration cost about 0.5S

aloyschen avatar Sep 03 '18 03:09 aloyschen

@aloyschen hi, that looks like much better than inference.

JSnobody avatar Sep 04 '18 01:09 JSnobody

Hi all. Is there any suggestion to optimize the speed of inference? @JSnobody @aloyschen Thanks!

lkj1114889770 avatar Sep 26 '18 03:09 lkj1114889770

I change the code of self.eval(). Specifically, I change the way of NMS in the author's code, I do the NMS among all the boxes instead of doing the NMS for the boxes of the each class separately. It reduced the inference time obviously.

lkj1114889770 avatar Sep 27 '18 14:09 lkj1114889770

@lkj1114889770 在多种类别的目标检测中,NMS是需要按照每个类别去做的,不然两个不同种类的box iou很大的时候,一起做nms会出问题,如果要提高速度,可以尝试把nms改成gpu上计算。

aloyschen avatar Sep 27 '18 15:09 aloyschen

好,我试试,谢谢。 @aloyschen

lkj1114889770 avatar Sep 29 '18 09:09 lkj1114889770

楼主可以建个群,大家可以多交流交流噢

JSnobody avatar Sep 29 '18 13:09 JSnobody

Hi, May I ask how can you run your model in a loop? I tried running the detect.py in a loop but it gives me errors like Variable predict/darknet53/conv2d_1/kernel already exists. But if I set the kenel to be reuseable, the gpu would be initialized wvery time I run the detect.py

shuoyuanxu avatar Oct 14 '18 12:10 shuoyuanxu

https://github.com/viplix3/YOLO

viplix3 avatar Jan 03 '19 10:01 viplix3