Please provide the following information when requesting support.
• Hardware (A100/Orin)
• Network Type (Detectnet_v2)
Hello, I am working in a project that consists on detecting multiple types of vehicles from traffic cameras. In this phase, I am trying to finetune detectnet_v2 (traficcamnet) with a custom dataset. Following the tutorials I’ve managed to train some models (unpruned, pruned and quantized), the training curves look fine and performing “tao evaluate” and “tao inference” on the final weights yield good results.
The problems I am facing right now concern the export and deployment of such new models to the production environment. First I export an onnx model with “tao export”. The ONNX model is able to find objects of interest in images, however I do not know how to translate the bounding boxes raw outputs to actual bounding boxes in image coordinates (but this is not the main issue, at this point I trust the onnx model works, although any pointers on how to do this would be apreciated to fully trust this step is correct).
Then I copy the onnx model to my Jetson and here I have multiple problems when I start detectNet (passing the labels and inputs/outputs names accordingly).
1 - The onnx model has dynamic shapes (mainly the batch size) and this results in an error. I was able to fix this by creating a new onnx model with fixed batch size of 1 (but I am not sure this causes other errors down in the pipeline). Can we do “tao export” without dynamic axis?
2 - The model cannot bind the inputs/outputs, even if I set the correct names in the detectNet initialization, it expects the default names of “data” (for input) and “coverage”/“bboxes” (for outputs). Again, I was able to fix this by creating a new onnx model from the original changing the names of the input/output layers, but I am not sure this causes other errors down in the pipeline.
3 - With fixes 1 and 2 I can run detectNet but I get some weird detections (there are more classes than there should be) suggesting something went wrong in the process.
[tracker] dropped track -1 -> class=39 frames=0
[tracker] dropped track -1 -> class=46 frames=0
[tracker] dropped track -1 -> class=55 frames=0
[tracker] dropped track -1 -> class=8 frames=0
[tracker] dropped track -1 -> class=8 frames=0
[tracker] dropped track -1 -> class=40 frames=0
[tracker] dropped track -1 -> class=67 frames=0
[tracker] added track -1 -> class=24
[tracker] added track -1 -> class=46
[tracker] added track -1 -> class=55
[tracker] added track -1 -> class=39
[tracker] added track -1 -> class=8
[tracker] added track -1 -> class=8
[tracker] added track -1 -> class=40
[tracker] added track -1 -> class=62
[tracker] dropped track -1 -> class=24 frames=0
[tracker] dropped track -1 -> class=55 frames=0
[tracker] dropped track -1 -> class=39 frames=0
[tracker] dropped track -1 -> class=46 frames=0
[tracker] dropped track -1 -> class=8 frames=0
I am pretty sure the error is in the ONNX → TRT step (although some issue generating the onnx model is not 100% discarded). I have tried to use “trtexec” to generate a TRT engine from the onnx model and give that to detectNet, but I get the same result.
I would appreciate help to solve this issue.