• Hardware Platform (Jetson / GPU): Jetson Orin Nano
• DeepStream Version: 6.3
**• JetPack Version (valid for Jetson only): **
• TensorRT Version: 8.5.2.1
• Issue Type( questions, new requirements, bugs): Question/Bug
Hi there, I have been facing an issue regarding the accuracy of classification models (caffe and ONNX) after converting them to TensorRT engines. Like in this post, I first tried using a custom classification model (yolov8-cls) to perform gender classification as a Secondary GIE, but was having issues with innaccurate predictions. More specifically, the model output was always the same class (1: Male) with confidence of 1.
I tested the ONNX model on the Jetson Orin Nano using this script:
testONNX.zip (835 Bytes)
. This performed as expected. I then converted it to a TensorRT engine using this command:
trtexec --onnx=genderClassification.onnx --saveEngine=genderClassification_fp16.trt --fp16
Using the following script, I tested the performance of the TensorRT engine and it exhibited the inaccurate behaviour described above
testTRT.zip (1.1 KB)
Following the suggestions in this post, I then tried implementing the Secondary_CarColor model as described in this FAQ post. I used the following command to build the TensorRT engine from the provided files:
trtexec --deploy=/opt/nvidia/deepstream/deepstream/samples/models/Secondary_CarColor/resnet18.prototxt --output=predictions/Softmax --maxBatch=1 --saveEngine=/opt/nvidia/deepstream/deepstream/samples/models/Secondary_CarColor/resnet18.caffemodel_b1_gpu0_int8.engine
I then used the following command to test the engine:
gst-launch-1.0 filesrc location=blueCar.jpg ! jpegdec ! videoconvert ! video/x-raw,format=I420 ! nvvideoconvert ! video/x-raw\(memory:NVMM\),format=NV12 ! mux.sink_0 nvstreammux name=mux batch-size=1 width=1280 height=720 ! nvinfer config-file-path=./dstest_appsrc_config.txt ! nvvideoconvert ! video/x-raw\(memory:NVMM\),format=RGBA ! nvdsosd ! nvvideoconvert ! video/x-raw,format=I420 ! jpegenc ! filesink location=out.jpg
Similarly to the behaviour exhibited with my custom model, this tensorRT engine also displays horrible accuracy, consistently labelling cars as “gold”.
I also tried building the engine using the --fp16 tag, with similar results.
Any assistance would be greatly appreciated