Different results in the deepstream-test2 example

The results in the deepstream-test2 example vary from run to run. Despite using the same TRT engine generated for the models, the classification model results differ from run to run. Occasionally, no classification model results are produced, while in other instances the results differ significantly. This occurs on different frames and boxes, despite the coordinates of the boxes themselves being the same (at least up to 6 decimal places).

Example of differences on frame 42 for the same box (coordinates in brackets). In the first run, there is a result from the model that determines the type of car, in the second run there is not.

< #42 found #5 (1603.571045, 543.909546, 84.856934, 62.139530) largevehicle Car
---
> #42 found #5 (1603.571045, 543.909546, 84.856934, 62.139530) Car

In this example there are different brands of cars.

< #1302 found #10 (738.833923, 479.535278, 638.922058, 463.091339) mercedes Car
---
> #1302 found #10 (738.833923, 479.535278, 638.922058, 463.091339) hyundai Car

Why do the results not match from run to run? How can we achieve deterministic results using the same engine models and input data?

• Hardware Platform (Jetson / GPU): rtx 2080
• DeepStream Version: 6.2
• TensorRT Version: 8.5.2
• NVIDIA GPU Driver Version (valid for GPU only): 525.60.11
• Issue Type( questions, new requirements, bugs): bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing):

Docker image and use a small plugin to analyze the results from NvDsObjectMeta for easy comparison. Here are the steps:

  1. Download the archive. reproduce.zip (4.9 KB)
  2. Unzip the archive unzip reproduce.zip && cd reproduce
  3. Build the Docker image docker build -t deepstream
  4. Run the Docker image docker run -it --rm --gpus all deepstream
  5. Go to to the deepstream-test2 example folder cd sources/apps/sample_apps/deepstream-test2/
  6. Run the example twice and write the results to different files.
gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! \
queue ! m.sink_0 nvstreammux name=m batch-size=1 width=1920 height=1080 ! \
queue ! nvvideoconvert ! queue ! \
nvinfer config-file-path="dstest2_pgie_config.txt" ! queue ! \
nvtracker tracker-width=640 tracker-height=384 ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so \
ll-config-file=../../../../samples/configs/deepstream-app/config_tracker_NvDCF_perf.yml enable-batch-process=1 ! \
nvinfer config-file-path="dstest2_sgie2_config.txt" ! \
nvinfer config-file-path="dstest2_sgie3_config.txt" ! \
queue ! dsmetapublish ! fakesink > res1.txt
gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! \
queue ! m.sink_0 nvstreammux name=m batch-size=1 width=1920 height=1080 ! \
queue ! nvvideoconvert ! queue ! \
nvinfer config-file-path="dstest2_pgie_config.txt" ! queue ! \
nvtracker tracker-width=640 tracker-height=384 ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so \
ll-config-file=../../../../samples/configs/deepstream-app/config_tracker_NvDCF_perf.yml enable-batch-process=1 ! \
nvinfer config-file-path="dstest2_sgie2_config.txt" ! \
nvinfer config-file-path="dstest2_sgie3_config.txt" ! \
queue ! dsmetapublish ! fakesink > res2.txt
  1. Compare the results diff res1.txt res2.txt

I run the deepstream-test2 with DS6.2 on T4 platform. The results are same.
res1.txt (1.5 MB)
res2.txt (1.5 MB)
Could you get the image from the video and test it with the picture?
I’ll try some other platform.

  1. I have reviewed your files and found the following differences between them:
Differences
275c264
< #24 found #9 (600.648926, 475.487335, 77.804260, 64.512146) Car
---
> #24 found #9 (600.648926, 475.487335, 77.804260, 64.512146) gmc Car
326c315
< #30 found #5 (603.277832, 475.382751, 85.940002, 70.229286) gmc Car
---
> #30 found #5 (603.277832, 475.382751, 85.940002, 70.229286) ford Car
330c319
< #30 found #9 (935.750000, 489.947205, 166.107697, 86.570763) coupe Car
---
> #30 found #9 (935.750000, 489.947205, 166.107697, 86.570763) Car
557c546
< #48 found #10 (1211.132690, 494.692352, 340.924164, 154.241699) Car
---
> #48 found #10 (1211.132690, 494.692352, 340.924164, 154.241699) coupe Car
634c623
< #54 found #9 (1395.536011, 502.726807, 439.139191, 191.725677) sedan toyota Car
---
> #54 found #9 (1395.536011, 502.726807, 439.139191, 191.725677) sedan Car
729c718
< #61 found #8 (836.724487, 530.987305, 632.268677, 480.867432) sedan nissan Car
---
> #61 found #8 (836.724487, 530.987305, 632.268677, 480.867432) coupe hyundai Car
9766c9755
< #575 found #8 (965.506165, 471.360809, 617.641663, 340.467133) suv Car
---
> #575 found #8 (965.506165, 471.360809, 617.641663, 340.467133) truck toyota Car
11972c11961
< #749 found #11 (869.416443, 481.333099, 124.868317, 122.320107) sedan Car
---
> #749 found #11 (869.416443, 481.333099, 124.868317, 122.320107) sedan honda Car
11974c11963
< #749 found #13 (616.496826, 489.572235, 96.820770, 76.198982) chevrolet Car
---
> #749 found #13 (616.496826, 489.572235, 96.820770, 76.198982) Car
11980c11969
< #750 found #6 (865.435730, 477.039337, 128.127869, 105.357430) sedan honda Car
---
> #750 found #6 (865.435730, 477.039337, 128.127869, 105.357430) suv Car
12011c12000
< #752 found #11 (886.311218, 484.086029, 203.005737, 128.354309) Car
---
> #752 found #11 (886.311218, 484.086029, 203.005737, 128.354309) lexus Car
12060,12061c12049,12050
< #755 found #14 (622.669189, 491.446564, 109.452896, 83.897865) Car
< #755 found #15 (916.712402, 489.571045, 256.649231, 151.647888) sedan lexus Car
---
> #755 found #14 (622.669189, 491.446564, 109.452896, 83.897865) truck Car
> #755 found #15 (916.712402, 489.571045, 256.649231, 151.647888) suv lexus Car
12063c12052
< #755 found #17 (1146.424927, 485.050842, 224.190674, 98.075897) Car
---
> #755 found #17 (1146.424927, 485.050842, 224.190674, 98.075897) coupe Car
12276c12265
< #769 found #8 (1524.255615, 498.676758, 285.090271, 151.793167) sedan Car
---
> #769 found #8 (1524.255615, 498.676758, 285.090271, 151.793167) sedan hyundai Car
12695c12684
< #798 found #8 (611.616455, 478.666077, 105.395691, 87.403793) truck nissan Car
---
> #798 found #8 (611.616455, 478.666077, 105.395691, 87.403793) truck Car
12705c12694
< #799 found #9 (1336.313721, 497.430847, 294.465729, 120.679710) sedan Car
---
> #799 found #9 (1336.313721, 497.430847, 294.465729, 120.679710) sedan audi Car
19113c19102
< #1218 found #13 (695.182495, 503.267242, 222.651031, 144.532791) sedan bmw Car
---
> #1218 found #13 (695.182495, 503.267242, 222.651031, 144.532791) sedan audi Car
20442c20431
< #1314 found #11 (664.764343, 506.057220, 123.975266, 87.855347) truck Car
---
> #1314 found #11 (664.764343, 506.057220, 123.975266, 87.855347) truck honda Car
21963c21952
< #1419 found #7 (796.241577, 573.172241, 677.798340, 447.947144) coupe hyundai Car
---
> #1419 found #7 (796.241577, 573.172241, 677.798340, 447.947144) coupe Car
21967c21956
< #1419 found #11 (724.070557, 479.479401, 83.827423, 71.344139) truck ford Car
---
> #1419 found #11 (724.070557, 479.479401, 83.827423, 71.344139) truck Car
22250c22239

  1. I have made modifications to the startup command and the plugin to output meta-information. The object_id is now output instead ordinal number of object, making it easier to compare with what the osd plugin draws. Additionally, I have added the functionality to save the final video. Please find the updated archive with the dockerfile and plugin, output logs of two runs, video files of results, and folders saved by frame using ffmpeg at the link below. Link to code and result
Command for starting a pipelining with video saving
gst-launch-1.0 uridecodebin uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! \
queue ! m.sink_0 nvstreammux name=m batch-size=1 width=1920 height=1080 ! \
queue ! nvvideoconvert ! queue ! \
nvinfer config-file-path="dstest2_pgie_config.txt" ! queue ! \
nvtracker tracker-width=640 tracker-height=384 ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so \
ll-config-file=../../../../samples/configs/deepstream-app/config_tracker_NvDCF_perf.yml enable-batch-process=1 ! \
nvinfer config-file-path="dstest2_sgie2_config.txt" ! \
nvinfer config-file-path="dstest2_sgie3_config.txt" ! \
queue ! dsmetapublish ! nvdsosd !  nvvideoconvert ! \
nvv4l2h264enc ! h264parse ! qtmux ! filesink location=/data/res1.mp4 > res1.txt

There are still differences in the results, for example, between res1/image00004.jpg and res2/image00004.jpg. Another example es1/image00032.jpg and res2/image00032.jpg. I have also observed that the metadata output in the logs starts from the second frame, but in the video, it starts from the third frame and is shifted by one frame, which is also strange.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Thanks. I just compared the coordinates of bbox before. So there are still some differences in labels. We’ll check it.
Also, could you set the classifier-async-mode=0 in the config file and check if it works well?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.