# tensorrt inference result is wrong and inconsistent with caffe inference result

**URL:** <https://forums.developer.nvidia.com/t/tensorrt-inference-result-is-wrong-and-inconsistent-with-caffe-inference-result/111010>\
**Category:** TensorRT\
**Created:** [January 27, 2020, 10:44am UTC](https://forums.developer.nvidia.com/t/tensorrt-inference-result-is-wrong-and-inconsistent-with-caffe-inference-result/111010 "2020-01-27T10:44:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxjan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@zxjan](https://forums.developer.nvidia.com/u/zxjan)\
**Post date:** [January 27, 2020, 10:44am UTC](https://forums.developer.nvidia.com/t/tensorrt-inference-result-is-wrong-and-inconsistent-with-caffe-inference-result/111010/1 "2020-01-27T10:44:36Z")

</div>

Dear nvidia expert,

I encountered a problem, which need your help.

I have trained a Chinese vehicle plate OCR recognition CNN network.

I tested the trained model via caffe with a picture named test.jpg, and got the expected OCR result, just as attached caffe\_result.png shows.  
Then I converted caffe model to tensorrt float32 engine and tested the converted engine via tensorrt C++ inference API. Unfortunately the OCR result is wrong(Please refer to attached trt\_result.png). It seems that the tensorrt result always miss the first or the last character.

I attached the caffemodel, prototxt, converted tensorrt engine, and tensorrt / caffe inference test codes. Please help me to fix this problem.

Besides, my env is listed below:

OS: Ubuntu 16.04  
cuda driver: 418.39  
GPU card: tesla T4  
tensorrt: 5.1.2.1+cuda10.1  
cudnn: 7.5  
cuda: 10.1

caffe: 1.1.0  
[newlp\_attach.7z](https://forums.developer.nvidia.com/uploads/short-url/79Sl0gsAj1NSPfgXmInn0bnVBtq.7z) (15.4 MB)

---

<div class="post-metadata">

**Author:** ![SunilJB](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/suniljb/32/14043_2.png) [@SunilJB](https://forums.developer.nvidia.com/u/SunilJB)\
**Post date:** [January 27, 2020, 5:43pm UTC](https://forums.developer.nvidia.com/t/tensorrt-inference-result-is-wrong-and-inconsistent-with-caffe-inference-result/111010/2 "2020-01-27T17:43:48Z")

</div>

Hi,

Could you please try latest TRT 7 release?

If issue persist, please share the error log and caffe model prototxt file as well.

Thanks

---

<div class="post-metadata">

**Author:** ![omar\_zeb](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@omar\_zeb](https://forums.developer.nvidia.com/u/omar_zeb)\
**Post date:** [February 27, 2020, 6:39am UTC](https://forums.developer.nvidia.com/t/tensorrt-inference-result-is-wrong-and-inconsistent-with-caffe-inference-result/111010/3 "2020-02-27T06:39:01Z")

</div>

Dear @SunilJB

We upgraded the tensorRT to TRT 7 and rebuilt the engine but got the same wrong results. We are building Caffe SSD 512 and the env configuration is:

OS: Ubuntu 16.04  
cuda driver: 410.48  
GPU card: RTX 2080 TI  
tensorrt: 7.0.0.1+cuda10.0  
cudnn: 7.5  
cuda: 10.0
