I am using TensorRT int8 inference, but get wrong results. error occurs at the last three layer.

I am using TensorRT int8 inference, but the inference result is wrong.

Then, I compare the result with my float inference layer by layer.

It shows that all the layers before the last three layers are generating the correct results.

Errors occur at the last three layers.

My last three layers are:

convolution+relu(1) ->  convolution+relu(2) -> convolution(3)

layer(1) has maximum 0.21 difference from the float inference result.
layer(2) has maximum 2.9 difference from the float inference result.
layer(3) has maximum 5.7 difference from the float inference result.

I used 3000 image for calibration, and expected good int8 inference.

Do you have any ideas of the reasons?

Thanks!

There is an interesting phenomenon,

If I mark some layers in the middle of the network, and generate int8 .net file

I can get the correct result using that .net file.

But if I only mark the last layer as my output,

using the generated .net cannot output correct result.

I wonder why this curious thing happens