Getting different result on tlt vs fp16/fp32 engine file

Hi @Morganh and Team,

Below is the hardware details
• Hardware: 2080TI
• Network Type: Classification
• TLT Version: nvcr.io/nvidia/tlt-streamanalytics:v3.0-dp-py3

Problem Description: I have trained one classification model on resnet10 and resnet18, I have re-trained it and run !classification inference on images and It generated csv file and which gave me the expected result but when I generated etlt in tlt container and engine file using tlt-converter for fp32/fp16 both (outside container) there I am getting very different result on the same image which I had used with !classification inference inside tlt container.

Input Images:

!classification inference CSV Result:

/workspace/tlt-experiments/data/split/cropped_imgs/CELL_1.jpg,NonFire,0.7731145024299622
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_10.jpg,Fire,0.6726871728897095
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_11.jpg,Fire,0.9121525287628174
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_12.jpg,Fire,0.8191258311271667
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_13.jpg,Fire,0.9918909072875977
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_14.jpg,Fire,0.9948790073394775
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_15.jpg,Fire,0.9938657879829407
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_16.jpg,Fire,0.9645125865936279
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_17.jpg,NonFire,0.9593686461448669
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_18.jpg,Fire,0.8300582766532898
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_19.jpg,Fire,0.9632471203804016
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_2.jpg,Fire,0.9915372133255005
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_20.jpg,Fire,0.9828284382820129
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_21.jpg,Fire,0.9855505228042603
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_22.jpg,Fire,0.9717434048652649
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_23.jpg,Fire,0.8446310758590698
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_24.jpg,Fire,0.9870462417602539
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_25.jpg,Fire,0.9247296452522278
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_26.jpg,Fire,0.9982082843780518
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_27.jpg,Fire,0.6313597559928894
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_28.jpg,NonFire,0.6591824889183044
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_29.jpg,Fire,0.902121365070343
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_3.jpg,Fire,0.99302738904953
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_30.jpg,Fire,0.8448091149330139
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_31.jpg,Fire,0.989149272441864
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_32.jpg,Fire,0.951098620891571
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_33.jpg,NonFire,0.6068366169929504
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_34.jpg,Fire,0.8034024238586426
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_35.jpg,NonFire,0.6692550182342529
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_36.jpg,NonFire,0.8291150331497192
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_37.jpg,Fire,0.5189791917800903
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_38.jpg,Fire,0.5528897643089294
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_39.jpg,NonFire,0.6556787490844727
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_4.jpg,Fire,0.9881834387779236
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_40.jpg,Fire,0.5054283738136292
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_41.jpg,NonFire,0.5591471791267395
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_42.jpg,NonFire,0.7875189781188965
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_43.jpg,NonFire,0.764715313911438
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_44.jpg,NonFire,0.8368709087371826
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_45.jpg,NonFire,0.9181521534919739
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_5.jpg,Fire,0.9922083020210266
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_6.jpg,Fire,0.8994458317756653
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_7.jpg,Fire,0.6510639190673828
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_8.jpg,NonFire,0.9657491445541382
/workspace/tlt-experiments/data/split/cropped_imgs/CELL_9.jpg,NonFire,0.9764096736907959

Result From fp16 Engine:

CELL_1.jpg,NonFire,0.99341184
CELL_2.jpg,NonFire,0.874561
CELL_3.jpg,Fire,0.7573863
CELL_4.jpg,NonFire,0.9809884
CELL_5.jpg,NonFire,0.653991
CELL_6.jpg,NonFire,0.9905099
CELL_7.jpg,NonFire,0.99989116
CELL_8.jpg,NonFire,0.99923134
CELL_9.jpg,NonFire,0.9976295
CELL_10.jpg,NonFire,0.90327984
CELL_11.jpg,NonFire,0.9255757
CELL_12.jpg,NonFire,0.9385526
CELL_13.jpg,NonFire,0.5574822
CELL_14.jpg,NonFire,0.6428577
CELL_15.jpg,NonFire,0.84311086
CELL_16.jpg,NonFire,0.9928976
CELL_17.jpg,NonFire,0.9995968
CELL_18.jpg,NonFire,0.99934417
CELL_19.jpg,NonFire,0.98644197
CELL_20.jpg,NonFire,0.94866914
CELL_21.jpg,NonFire,0.97156173
CELL_22.jpg,NonFire,0.723124
CELL_23.jpg,NonFire,0.91532326
CELL_24.jpg,NonFire,0.97118413
CELL_25.jpg,NonFire,0.78124255
CELL_26.jpg,NonFire,0.97998744
CELL_27.jpg,NonFire,0.9861217
CELL_28.jpg,NonFire,0.99347174
CELL_29.jpg,NonFire,0.84629303
CELL_30.jpg,NonFire,0.97959006
CELL_31.jpg,NonFire,0.99634296
CELL_32.jpg,NonFire,0.982196
CELL_33.jpg,NonFire,0.93243223
CELL_34.jpg,NonFire,0.99593914
CELL_35.jpg,NonFire,0.99392456
CELL_36.jpg,NonFire,0.992339
CELL_37.jpg,NonFire,0.9218907
CELL_38.jpg,NonFire,0.8384702
CELL_39.jpg,NonFire,0.97472966
CELL_40.jpg,NonFire,0.9630938
CELL_41.jpg,NonFire,0.9782209
CELL_42.jpg,NonFire,0.9700463
CELL_43.jpg,NonFire,0.9285461
CELL_44.jpg,NonFire,0.9697337
CELL_45.jpg,NonFire,0.9881352

Engine Generation Command:

./tlt-converter FireRes18_Ep20_V1.1.etlt -k key -o predictions/Softmax -d 3,224,224 -i nchw -e FireRes18_Ep20_fp16_V1.1.engine -m 1 -t fp16 -b 1

Please let me know where I am making mistake. Is there any problem with tlt-conveter command or script?

Thanks.

Refer to Inferring resnet18 classification etlt model with python - #40 by Morganh

Thanks a lot @Morganh.

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