YOLOv3-Torch2TRT
YOLOv3-Torch2TRT copied to clipboard
No detections output from the model
The model doesn't detect any object! I printed the detections tensor before and after the Non Maximum Suppression and here are the outputs:
Before
tensor([[[ 0., 0., 0., ..., 0., 0., 0.],
[32., 0., 0., ..., 0., 0., 0.],
[64., 0., 0., ..., 0., 0., 0.],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]]])
After
[None]
This issue appears when I use the TensorRT model. when I use TensorRT = False, There are some issues with the detections as well. The model doesn't detect all objects.
I want to use YOLOv3-TRT with its good accuracy, How can I solve this issue?
Hi @baheytharwat Sorry for long time no reply,I have been busy with other work in the past half a year and rarely check this repo. For your problem,you should check items as follow:
- pretrained weights
- image folder
- you can let
half flag = false
and deletemodel.eval()
to test code
If it is still wrong, then maybe I wrote the wrong code in some place, you need to check my code by yourself.
Hi @DocF
Thanks for your response, I checked what you have said: pretrained weights and Image folder and both of them are fine. When I use half = false
, I get an error in NMS function. So, before I start checking your code. I want you to check on your pc if the code works and detects the objects well - If you have free time -