torch2trt icon indicating copy to clipboard operation
torch2trt copied to clipboard

Lower accuracy when converted to fp32 trt model

Open poornimajd opened this issue 3 years ago • 4 comments

Hello,Great work! I have a pytorch segmentation model,which has been trained on a custom dataset.When I convert this model to the tensorrt version,I get a decrease in miou score from 89 to 66 ,though it is just fp32 version.I wonder why does the accuracy decrease so much.I used the following dependencies Pytorch- 1.7.1 Cuda- 10.2 TensorRT-7.1.3 I also tried passing the input as x= x.contiguous() , as referred in the previous issues. My model has a bilinear interpolation layer ,but since it is a higher version of tensorRT ,I thought that this cannot bring down the accuracy so much. What could be the problem here? Any suggestion is greatly appreciated. Thank you

poornimajd avatar Mar 30 '21 03:03 poornimajd

Do you solve the problem? I meet a similar problem, the miou decreases from 82 to 78. Thank you very much.

purse1996 avatar Jul 26 '21 07:07 purse1996

Do you solve the problem? I meet a similar problem too. Thank you very much.

ryandok avatar Nov 13 '21 05:11 ryandok

no not yet.

poornimajd avatar Nov 13 '21 08:11 poornimajd

I also had the same issue. Converting a torch model with the same precision (fp32) changed the model output.

YOONAHLEE avatar Aug 11 '22 01:08 YOONAHLEE

Having the same issue. Original PyTorch model gave excellent results. However, PyTorch --> TRT conversion led to decrease in score and increase in errors.

Shubham-Omprakash-Patil avatar Jan 23 '23 19:01 Shubham-Omprakash-Patil