# Difference between predictions of exported TensorRT engine and PyTorch pth models

**URL:** <https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389>\
**Category:** DeepStream SDK\
**Created:** [February 2, 2023, 9:22am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389 "2023-02-02T09:22:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 2, 2023, 9:22am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/1 "2023-02-02T09:22:34Z")

</div>

**Problem:** Inference results from deepstream and local inference do not match (using same png images)  
While testing what percentage of predictions match between engine and pth models I get that only 26% matched out of 180k images.

**How I reproduce results:** I save images after they go through streammux, so in 416x416 shape and in .png format. For each image I also save bounding box coordinates where YoloV4 detected objects. To test predictions I download images and bounding box coordinates for each image, then I crop object based on bounding box coordinates and run resulting image through pth model.

**Version:** Deepstream 5.1

**Model training:** I train EfficientNetB0 locally with PyTorch and use following transformations for loading data (we are training 128 classes):

import Albumentations as A  
from albumentations.pytorch import ToTensorV2  
train\_transforms = A.Compose(  
[ A.Resize(height=224, width=224),  
A.HorizontalFlip(p=0.5),  
A.VerticalFlip(p=0.5),  
A.RandomGamma(gamma\_limit=(75, 90), p=0.8),  
A.GridDropout(ratio=0.47, p=0.6),  
A.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),  
ToTensorV2()]

**Model inference locally:** I run inference with following preprocessing:

test\_transforms = A.Compose(  
[ A.Resize(height=224, width=224),  
A.Normalize(mean=(0.485, 0.456, 0.406),  
std=(0.229, 0.224, 0.225)),  
ToTensorV2()]

**Steps i do to export model:**

1. Convert trained model to .onnx:

model = efficientnet\_b0(pretrained=False)  
pt\_model = torch.load(path\_to\_torch\_model, map\_location=torch.device(‘cpu’))  
n\_features = model.classifier[1].in\_features  
model.classifier[1] = nn.Linear(n\_features, classes)  
model.load\_state\_dict(pt\_model)  
model = nn.Sequential(model, nn.Softmax(-1))  
dummy\_input = torch.randn(batch\_size, 3, 224, 224)  
torch.onnx.export(model, dummy\_input, path\_to\_onnx, verbose=False, input\_names=[‘input\_names’], output\_names=[‘output\_names’], export\_params=True)

I checked that converted onnx model **gives same results** as pytorch model.

1. Export .onnx to engine file with following command:

`docker container run --gpus all --rm --volume $(pwd):/workspace/ --volume $(pwd):/data/ --workdir /workspace/ nvcr.io/nvidia/tensorrt:21.02-py3 trtexec --explicitBatch --onnx=best_23.onnx --saveEngine=efficientnet.engine --fp16 --workspace=4096`

**Deepstream configuration:**

RTSP stream → Streammux (reshaping to 416x416) → YoloV4 (bounding boxes) → Classification

Deepstream classification config:

[property]  
gpu-id=0  
offsets=103.53;116.28;123.675  
net-scale-factor=0.01735207357279195  
labelfile-path=…/classifier/labels.txt  
model-engine-file=…/classifier/efficientnet.engine  
infer-dims=3;224;224  
network-mode=2  
network-type=1  
num-detected-classes=128  
interval=0  
classifier-threshold=0

**Questions:**

1. How can I achieve same preprocessing during training in python as in deepstream inference, because I guess that albumentation package gives different interpolation result than deepstream inference?
2. Maybe there are other mistakes that I cant see?

---

<div class="post-metadata">

**Author:** ![spolisetty](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/spolisetty/32/14047_2.png) [@spolisetty](https://forums.developer.nvidia.com/u/spolisetty)\
**Post date:** [February 3, 2023, 6:27am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/2 "2023-02-03T06:27:58Z")

</div>

Hi,

> [@zygimantas.lukosevicius](#):
>
> **Questions:**
> 
> 1. How can I achieve same preprocessing during training in python as in deepstream inference, because I guess that albumentation package gives different interpolation result than deepstream inference?
> 2. Maybe there are other mistakes that I cant see?

We are moving this post to the Deepstream forum to get better help.

Thank you.

---

<div class="post-metadata">

**Author:** ![mchi](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mchi/32/14043_2.png) [@mchi](https://forums.developer.nvidia.com/u/mchi)\
**Post date:** [February 3, 2023, 6:55am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/4 "2023-02-03T06:55:33Z")

</div>

Hi @Zygislu ,  
Could you refer to [DeepStream SDK FAQ - #21 by mchi](https://forums.developer.nvidia.com/t/deepstream-sdk-faq/80236/21) to check the DeepStream config for the model?

Thanks!

---

<div class="post-metadata">

**Author:** ![marmikshah](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marmikshah](https://forums.developer.nvidia.com/u/marmikshah)\
**Post date:** [February 3, 2023, 8:47am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/5 "2023-02-03T08:47:59Z")

</div>

> [@Zygislu](#):
>
> 103.53;116.28;123.675

Are you training with BGR or RGB?  
Your offsets in nvinfer are I think in BGR but your normalisation in pytorch seems to be RGB.

And for your Resize in pytorch does it maintain aspect ratio? If yes, what kind of padding does it add?  
Nvinfer by default does not maintain aspect ratio, but if it does it will either do bottom right zero padding or symmetric-padding (if `symmetric-padding=1`)

Lastly did you check your Resize Interpolation method? If I remember correctly, default in pytorch is different from default in nvinfer.

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 3, 2023, 2:32pm UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/6 "2023-02-03T14:32:41Z")

</div>

Hi,  
We made some steps which helped us to achieve better result, but we still get only 60% images predictions match between deepstream and local pytorch inferences.

Steps that we made:

1. We changed nvinfer offset to RGB (offsets=123.675;116.28;103.53)

2. We trained new model based on images saved from deepstream (in png format) after object detection phase with following pytorch transformations:  
def get\_transforms():

As you can see we are using INTER\_NEAREST method, because we find out that this method is used by deepstream ([About the resize method in nvvideoconvert/nvstreammux - #6 by Fiona.Chen](https://forums.developer.nvidia.com/t/about-the-resize-method-in-nvvideoconvert-nvstreammux/166261/6))

We know the fact that different libraries gives different resizing result even though using same interpolation methods and because of that it is crucial for us to know how nvinfer interpolation method works and how it can be replicated in our offline training to achieve same preprocessing in production and offline environments.  
We hope that someone have solved similar issue and can share information with us.

Thanks

---

<div class="post-metadata">

**Author:** ![marmikshah](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marmikshah](https://forums.developer.nvidia.com/u/marmikshah)\
**Post date:** [February 6, 2023, 1:15am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/7 "2023-02-06T01:15:50Z")

</div>

> [@Zygislu](#):
>
> As you can see we are using INTER\_NEAREST method, because we find out that this method is used by deepstream

I had been struggling with a similar problem. So I ended up using `scaling-fitler=1` or `scaling-filter=2` in the SGIE configuration file. Note that I had not changed the resize method for Streammux as I did not need to resize there.

To confirm my results, I had exported the crops from deepstream’s detector and run inference on them in pytorch (which was much higher than what i was getting in deepstream).  
So I played around with the scaling filter and just by changing to `scaling-filter=1`, the accuracy went up significantly (~15-20% on different videos). `scaling-filter=2` had similar results but it kept crashing on dGPU so I stuck to `scaling-filter=1`

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 7, 2023, 11:18am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/8 "2023-02-07T11:18:22Z")

</div>

Thank you for your suggestions.  
Changing offsets to `123.675;116.28;103.53` improved results the most and `scaling-filter=1` helped get better results as well. But there are still mismatches between models predictions, now only ~20% predictions mismatch, compared to previously ~75%.

I have also tried every suggestion @mchi referred, but none improved results.

---

<div class="post-metadata">

**Author:** ![marmikshah](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marmikshah](https://forums.developer.nvidia.com/u/marmikshah)\
**Post date:** [February 7, 2023, 11:30am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/9 "2023-02-07T11:30:51Z")

</div>

I see.  
Lastly I can think of the precision. How about try to run with fp32? (`network-mode=0`) and check?  
And maybe also explicitly disable `maintain-aspect-ratio=0` because your pytorch resize does not maintain the aspect ratio.

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 7, 2023, 12:59pm UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/10 "2023-02-07T12:59:28Z")

</div>

Right I forgot to mention that I had also changed network-mode=0 previously and I’m not using `A.Resize(height=224, width=224, interpolation=cv2.INTER_NEAREST)` anymore but went back to using `A.Resize(height=224, width=224)` because results got worse in most cases while changing settings that @mchi referred to.

I have tried what you mention by adding explicitly `maintain-aspect-ratio=0` but it had no impact on results.

---

<div class="post-metadata">

**Author:** ![marmikshah](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marmikshah](https://forums.developer.nvidia.com/u/marmikshah)\
**Post date:** [February 8, 2023, 1:21am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/11 "2023-02-08T01:21:36Z")

</div>

I see.  
Would it be easy for you to train a new model with a

1. Resize with aspect ratio; and
2. Bottom-Right zero padding

(Something like this [Resize image while maintaing the aspect ratio · Issue #718 · albumentations-team/albumentations · GitHub](https://github.com/albumentations-team/albumentations/issues/718#issuecomment-983151394)) I have not tested this augmentation, you may need to try.

Then try by `maintain-aspect-ratio=1` in your sgie config file.

---

<div class="post-metadata">

**Author:** ![mchi](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mchi/32/14043_2.png) [@mchi](https://forums.developer.nvidia.com/u/mchi)\
**Post date:** [February 8, 2023, 2:31am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/12 "2023-02-08T02:31:04Z")

</div>

> [@Zygislu](#):
>
> test\_transforms = A.Compose(  
> [ A.Resize(height=224, width=224),  
> A.Normalize(mean=(0.485, 0.456, 0.406),  
> std=(0.229, 0.224, 0.225)),  
> ToTensorV2()]

According to this, the pre-processing in local inference is: (input - mean) \* std

And, according to your deepstream config below, it’s : (input - offsets) \* net-scale-factor

So, to make these two match, you need to make:

1. net-scale-factor = std
2. offsets \* net-scale = factormean \* std

And, try avoiding scaling in nvstreammux.

> [property]  
> gpu-id=0  
> offsets=103.53;116.28;123.675  
> net-scale-factor=0.01735207357279195  
> labelfile-path=…/classifier/labels.txt  
> model-engine-file=…/classifier/efficientnet.engine  
> infer-dims=3;224;224

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 8, 2023, 7:47am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/13 "2023-02-08T07:47:36Z")

</div>

Could you explain in more detail how I should change my `offsets` and `net-scale-factor`, because currently I have it calculated according to this [comment](https://forums.developer.nvidia.com/t/pytorch-normalization-in-deepstream-config/158154/7) where:  
`np.array([0.485, 0.456, 0.406])*255` = `array([123.675, 116.28 , 103.53])`  
And `np.array([0.229, 0.224, 0.225]).mean()*255` = 57.63  
Therefore `net-scale-factor` is going to be `1/57.63 = 0.01735207357279195.`

---

<div class="post-metadata">

**Author:** ![mchi](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mchi/32/14043_2.png) [@mchi](https://forums.developer.nvidia.com/u/mchi)\
**Post date:** [February 8, 2023, 7:50am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/14 "2023-02-08T07:50:44Z")

</div>

you can refer to  
[https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS\_plugin\_gst-nvinfer.html#gst-nvinfer](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html#gst-nvinfer)

 ![image](https://global.discourse-cdn.com/nvidia/original/3X/0/7/072969790056906e96bca3fdb7df3631dc5ac3f5.png)

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 9, 2023, 11:29am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/15 "2023-02-09T11:29:14Z")

</div>

I have retrained my model with these transformations:  
train\_transforms = A.Compose(  
[  
A.LongestMaxSize(max\_size=224, interpolation=1),  
A.PadIfNeeded(min\_height=224, min\_width=224, border\_mode=0, value=(0, 0, 0)),  
A.HorizontalFlip(p=0.5),  
A.VerticalFlip(p=0.5),  
A.RandomGamma(gamma\_limit=(75, 90), p=0.8),  
A.GridDropout(ratio=0.47, p=0.6),  
A.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),  
ToTensorV2(),  
]  
)

And in config I have added `maintain-aspect-ratio=1`, but unfortunately results didn’t get better.  
I have also tried adding `symmetric-padding=1` and removing `scaling-filter=1` but it didn’t help aswell.

My current config I’m using:  
offsets=123.675;116.28;103.53  
net-scale-factor=0.01735207357279195  
network-input-order=0  
labelfile-path=…/picklist-classifier/labels.txt  
model-engine-file=…/picklist-classifier/efficientnet.engine  
infer-dims=3;224;224  
model-color-format=0  
network-mode=0  
network-type=1  
num-detected-classes=128  
interval=0  
classifier-threshold=0  
scaling-filter=1  
maintain-aspect-ratio=1

---

<div class="post-metadata">

**Author:** ![mchi](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mchi/32/14043_2.png) [@mchi](https://forums.developer.nvidia.com/u/mchi)\
**Post date:** [February 11, 2023, 2:03pm UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/16 "2023-02-11T14:03:28Z")

</div>

> [@Zygislu](#):
>
> A.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),

can you explain how this work? As I said above, does it do the same pre-processing with below DS config?

> offsets=123.675;116.28;103.53  
> net-scale-factor=0.01735207357279195

Have you gone through the option I listed in [DeepStream SDK FAQ - #21 by mchi](https://forums.developer.nvidia.com/t/deepstream-sdk-faq/80236/21) and confirm the settings are configued to be the same as that are used in training

---

<div class="post-metadata">

**Author:** ![marmikshah](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marmikshah](https://forums.developer.nvidia.com/u/marmikshah)\
**Post date:** [February 13, 2023, 1:26am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/17 "2023-02-13T01:26:10Z")

</div>

Sorry for the late reply,  
This augmentation is slightly different from Nvinfer’s preprocessing

```bash
A.PadIfNeeded(min_height=224, min_width=224, border_mode=0, value=(0, 0, 0)),

```

Can you please add this to get the same padding as nvinfer.

```bash
A.PadIfNeeded(min_height=224, min_width=224, border_mode=0, value=(0, 0, 0), position="top_left")

```

And its equivalent nvinfer config will be

```auto
maintain-aspect-ratio=1
symmetric-padding=0

```

Btw just want to confirm whether your PGIE has any object size filtering? What I mean is whether the PGIE discards objects below a certain size? If so, then maybe that could be an issue as well.

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 13, 2023, 8:59am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/18 "2023-02-13T08:59:55Z")

</div>

Yes, so I take:  
`mean=(0.485, 0.456, 0.406)` and multiply every value by 255, which equals to `123.675;116.28;103.53` e.g. 0.485 \* 255 = 123.675  
And for `std=(0.229, 0.224, 0.225)` I calculate mean of std which is (0.229+0.224+0.225) / 3 = 0.226 and then calculate `net-scale-factor` by 1 / (0.226 \* 255) = 0,017352074

I have gone through the options You have listed in [DeepStream SDK FAQ](https://forums.developer.nvidia.com/t/deepstream-sdk-faq/80236/21) and confirmed that I’m using the same ones for training as I’m for DS

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [February 13, 2023, 1:46pm UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/19 "2023-02-13T13:46:36Z")

</div>

Thank you for all the help so far.  
I have tried what you suggested by adding position=‘top\_left’ to PadIfNeeded function, however predictions on pth model and from deepstream still differ. Maybe you are right that I’m doing something wrong in my PGIE.

I’m using darknet YOLOv4 model in PGIE, it’s config:  
[property]  
gpu-id=0  
net-scale-factor=0.0039215697906911373  
model-color-format=0  
custom-network-config=…/yolo/checkpoint/yolov4.cfg  
model-file=…/yolo/checkpoint/yolov4.weights  
model-engine-file=…/yolo/checkpoint/model\_b1\_gpu0\_fp16.engine  
labelfile-path=…/yolo/labels.txt  
batch-size=10  
network-mode=2  
num-detected-classes=1  
interval=0  
gie-unique-id=1  
process-mode=1  
network-type=0  
cluster-mode=4  
maintain-aspect-ratio=0  
parse-bbox-func-name=NvDsInferParseYolo  
custom-lib-path=…/yolo/nvdsinfer\_custom\_impl\_Yolo/libnvdsinfer\_custom\_impl\_Yolo.so  
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]  
pre-cluster-threshold=0.4

Yolov4 cfg:  
[net]  
batch=64  
subdivisions=16  
width=256  
height=256  
channels=3  
momentum=0.949  
decay=0.0005  
angle=0  
saturation = 1.5  
exposure = 1.5  
hue=.1

learning\_rate=0.001  
burn\_in=1000  
max\_batches=6000  
policy=steps  
steps=4800, 5400  
scales=.1,.1

#cutmix=1  
mosaic=1

---

<div class="post-metadata">

**Author:** ![marmikshah](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@marmikshah](https://forums.developer.nvidia.com/u/marmikshah)\
**Post date:** [February 14, 2023, 1:19am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/20 "2023-02-14T01:19:47Z")

</div>

When you visualize your video, which of these situations occur?

1. Bbox there, but wrong classification  
Incase this happens, do you have a tracker between your PGIE and SGIE? (NOTE: Tracker may alter the bounding boxes which may cause some difference in classification result. So it would be good to move tracker after SGIE to verify.)
2. No bbox  
Incase this happens, very likely the detector is the problem. From the nvinfer code it seems the default min object width and height is 16. Are your objects smaller than that? Maybe they are being discarded? And I see you have disabled clustering, then I think it would be worth setting `pre-cluster-threshold=0.0` just to ensure each box is rendered.

---

<div class="post-metadata">

**Author:** ![Zygislu](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Zygislu](https://forums.developer.nvidia.com/u/Zygislu)\
**Post date:** [March 14, 2023, 6:48am UTC](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389/21 "2023-03-14T06:48:24Z")

</div>

Thank you for all the help @marmikshah

When I visualize my video I can see that bbox is there, but classifications are wrong. I do not have a tracker between PGIE and SGIE unfortunately.

Another thing I have tested is writing a benchmark script which takes engine model file and classifies images locally. This benchmark of engine model gives me matching results of 98% comparing predictions with pth model locally. However this engine file was generated on a different PC than which I’m running Deepstream 5.1 on and a different version of TensorRT was used. Instead of 7.2.2.3 (which is used in Deepstream 5.1) I have used 8.5.2.2 version for local engine benchmark, because only [newer versions](https://pypi.org/project/tensorrt/#history) are supported with tensorrt python package.

So my question is, can an older version of TensorRT decrease precision so drastically, or there is still something wrong with my deepstream config files?

[Next page](https://forums.developer.nvidia.com/t/difference-between-predictions-of-exported-tensorrt-engine-and-pytorch-pth-models/241389.md?page=2)
