tjuskyzhang / Scaled-YOLOv4-TensorRT

Got 100fps on TX2. Got 500fps on GeForce GTX 1660 Ti. If the project is useful to you, please Star it.
178 stars 41 forks source link

high inference times for initial images #27

Open saimouli opened 2 years ago

saimouli commented 2 years ago

It takes a long time to do inference for the first few images. Progressively the inference time reduces. Does engine generation optimize according to the device? Any cache/changes needed to make the inference time constant for any number of iterations?

000273.png
103ms preprocess
419ms inference

000237.png
2ms preprocess
14ms inference

000103.png
2ms preprocess
14ms inference
vjsrinivas commented 2 years ago

I believe this is just an unfortunate limitation of GPU kernel initialization. There is not much you can do other than maybe running dummy inputs for however many slow inferences there are before going into your real data.