TensorRT convert SSD model with plugin by myself from FP32 to INT8 failed

I want to convert SSD model from FP32 to INT8, which works well with FP32.When I build int8model,it reports like that:

sampleSSD: genericReformat.cu:1697: genericReformat::NStridesAndOffsets genericReformat::computeNStridesAndOffsets(const genericReformat::RegionDesc&, const genericReformat::Array&, const genericReformat::Array&, const genericReformat::RegionDesc&, const genericReformat::Array&, const genericReformat::Array&): Assertion `(dstStart.i[1] & (1 << dstDesc.lgScalarsPerElement)) == 0’ failed.

I use the model without dilate convolution,and the calibrationtable looks like that:

conv5_3_norm_mbox_loc_perm: 3d21a3e5
conv3_1: 3d0329c1
fc7_mbox_priorbox: 3cec18eb
pool2: 3cdfee76
conv6_2_mbox_conf: 3c25e12c
pool1: 3d91e0f6
conv5_1: 3cf194ce
conv7_2_mbox_loc: 3cd4a917
data: 4000890a
conv5_3_norm_mbox_loc: 3d21a3e5
conv5_3_norm_mbox_conf: 3cb6d466
pool3_1: 3d131691
conv4_3_norm_mbox_conf_perm: 3ca2d7b4
fc6: 3d0c5c87
fc7: 3c8c2fa0
conv6_2: 3c351350
conv7_1: 3c70db2f
conv5_3_norm_mbox_loc_flat copy: 3d21a3e5
conv7_2_mbox_conf_flat: 3c2c8717
conv7_2_mbox_conf: 3c2c8717
conv7_2_mbox_loc_flat: 3cd4a917
conv5_3_norm: 3c56608d
fc7_mbox_loc_flat copy: 3d14c1ea
conv6_1: 3c2f86bb
conv6_2_mbox_loc_flat: 3cdf0a04
conv7_2_mbox_conf_flat copy: 3c2c8717
conv4_3_norm_mbox_loc: 3d4517c5
pool5: 3cf140d5
conv5_3_norm_mbox_priorbox: 3cf6032f
conv6_2_mbox_conf_perm: 3c25e12c
fc7_mbox_conf_perm: 3c071645
conv6_2_mbox_loc: 3cdf0a04
conv4_3_norm_mbox_conf_flat: 3ca2d7b4
conv5_3_norm_mbox_conf_flat: 3cb6d466
conv4_1: 3cc1d3ae
conv6_2_mbox_loc_flat copy: 3cdf0a04
conv1: 3d85ce30
fc7_mbox_loc_perm: 3d14c1ea
mbox_conf_softmax: 36a0396c
conv6_2_mbox_loc_perm: 3cdf0a04
conv5_3_norm_mbox_conf_perm: 3cb6d466
conv4_3_norm_mbox_loc_perm: 3d4517c5
pool4_1: 3cef864e
conv7_2_mbox_conf_perm: 3c2c8717
fc7_mbox_conf: 3c071645
conv6_2_mbox_conf_flat copy: 3c25e12c
conv6_2_mbox_conf_flat: 3c25e12c
fc7_mbox_loc: 3d14c1ea
fc7_mbox_loc_flat: 3d14c1ea
conv7_2: 3c49ec4b
conv4_3_norm_mbox_conf: 3ca2d7b4
conv5_3_norm_mbox_loc_flat: 3d21a3e5
conv4_3_norm_mbox_loc_flat: 3d4517c5
conv6_2_mbox_priorbox: 3cb63aa6
fc7_mbox_conf_flat copy: 3c071645
conv7_2_mbox_loc_perm: 3cd4a917
mbox_conf_reshape: 3ca31ca9
fc7_mbox_conf_flat: 3c071645
conv2: 3cc6d153
conv7_2_mbox_loc_flat copy: 3cd4a917
mbox_priorbox: 4a4f799d
conv4_3_norm_mbox_loc_flat copy: 3d4517c5
conv4_3_norm_mbox_priorbox: 4a4f799d
conv4_3_norm_mbox_conf_flat copy: 3ca2d7b4
conv5_3_norm_mbox_conf_flat copy: 3cb6d466
conv7_2_mbox_priorbox: 3cc709e6
conv4_3_norm: 3ccf418c

I really have no idea with that,can someone knows how to solver it.


I have the same problem. Have you solved this problem ?

Hi, I have no idea about it. I don’t know where and why get this error.

In my prototxt, I use convolution instead of fc6 which has dilation.Because with dilation it may return a error which about workspace,when I remove it, this will gone.

By the way, YOLO V1 and V2 I had tested INT8 right.Only SSD can’t get the right answer.

Have you solved this problem? I’m also faced with that one.

Hi @604588292, any success with int8 optimization for SSD ?

Hi @Wahaj, if you want to do int8 optimization for SSD, you should use convolution instead of fc6 which has dilation with TensorRT3.x
I do not know why the convolution with dilation can not success with int8 optimization, maybe something wrong but i do not know,you can try what i say.