Hello,
I’m using slim yolov3 model based on DS4.0 ,and modified yolo parse code, tensorRT could parse the net successfully ,but the precision detection decreased a lot, I try to use diffferent network-mode ,but it still no improvement.
I checked all the config file ,not found any problem.
I just update two points based on source code of createYoloNetwork function.
Could you help me to check this problem ,I think it shouldn’t decrease so much for precision.
adding parse more tensor for “m_configBlocks.at(i).at(“type”) == “route””
2.adding same padding for yolov3 maxpool
else if (m_configBlocks.at(i).at("type") == "maxpool")
{
// Add same padding layers
if (m_configBlocks.at(i).at("size") == "2" && m_configBlocks.at(i).at("stride") == "1")
{
m_TinyMaxpoolPaddingFormula->addSamePaddingLayer("maxpool_" + std::to_string(i));
}
if (m_configBlocks.at(i).at("size") == "5" && m_configBlocks.at(i).at("stride") == "1")
{
m_TinyMaxpoolPaddingFormula->addSamePaddingLayer("maxpool_" + std::to_string(i));
}
if (m_configBlocks.at(i).at("size") == "9" && m_configBlocks.at(i).at("stride") == "1")
{
m_TinyMaxpoolPaddingFormula->addSamePaddingLayer("maxpool_" + std::to_string(i));
}
if (m_configBlocks.at(i).at("size") == "13" && m_configBlocks.at(i).at("stride") == "1")
{
m_TinyMaxpoolPaddingFormula->addSamePaddingLayer("maxpool_" + std::to_string(i));
}
std::string inputVol = dimsToString(previous->getDimensions());
nvinfer1::ILayer* out = netAddMaxpool(i, m_configBlocks.at(i), previous, network);
previous = out->getOutput(0);
assert(previous != nullptr);
std::string outputVol = dimsToString(previous->getDimensions());
tensorOutputs.push_back(out->getOutput(0));
printLayerInfo(layerIndex, "maxpool", inputVol, outputVol, std::to_string(weightPtr));
}
Using winsys: x11
Creating LL OSD context new
0:00:01.120080395 1614 0x7f38002300 INFO nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<primary_gie_classifier> NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:01.121460246 1614 0x7f38002300 WARN nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger:<primary_gie_classifier> NvDsInferContext[UID 1]:generateTRTModel(): INT8 not supported by platform. Trying FP16 mode.
Loading pre-trained weights...
Loading complete!
Total Number of weights read : 11114504
layer inp_size out_size weightPtr
(1) conv-bn-leaky 3 x 608 x 608 9 x 608 x 608 279
(2) conv-bn-leaky 9 x 608 x 608 50 x 304 x 304 4529
(3) conv-bn-leaky 50 x 304 x 304 25 x 304 x 304 5879
(4) conv-bn-leaky 25 x 304 x 304 50 x 304 x 304 17329
(5) skip 50 x 304 x 304 50 x 304 x 304 -
(6) conv-bn-leaky 50 x 304 x 304 117 x 152 x 152 70447
(7) conv-bn-leaky 117 x 152 x 152 16 x 152 x 152 72383
(8) conv-bn-leaky 16 x 152 x 152 117 x 152 x 152 89699
(9) skip 117 x 152 x 152 117 x 152 x 152 -
(10) conv-bn-leaky 117 x 152 x 152 40 x 152 x 152 94539
(11) conv-bn-leaky 40 x 152 x 152 117 x 152 x 152 137127
(12) skip 117 x 152 x 152 117 x 152 x 152 -
(13) conv-bn-leaky 117 x 152 x 152 244 x 76 x 76 395035
(14) conv-bn-leaky 244 x 76 x 76 43 x 76 x 76 405699
(15) conv-bn-leaky 43 x 76 x 76 244 x 76 x 76 501103
(16) skip 244 x 76 x 76 244 x 76 x 76 -
(17) conv-bn-leaky 244 x 76 x 76 71 x 76 x 76 518711
(18) conv-bn-leaky 71 x 76 x 76 244 x 76 x 76 675603
(19) skip 244 x 76 x 76 244 x 76 x 76 -
(20) conv-bn-leaky 244 x 76 x 76 74 x 76 x 76 693955
(21) conv-bn-leaky 74 x 76 x 76 244 x 76 x 76 857435
(22) skip 244 x 76 x 76 244 x 76 x 76 -
(23) conv-bn-leaky 244 x 76 x 76 63 x 76 x 76 873059
(24) conv-bn-leaky 63 x 76 x 76 244 x 76 x 76 1012383
(25) skip 244 x 76 x 76 244 x 76 x 76 -
(26) conv-bn-leaky 244 x 76 x 76 48 x 76 x 76 1024287
(27) conv-bn-leaky 48 x 76 x 76 244 x 76 x 76 1130671
(28) skip 244 x 76 x 76 244 x 76 x 76 -
(29) conv-bn-leaky 244 x 76 x 76 56 x 76 x 76 1144559
(30) conv-bn-leaky 56 x 76 x 76 244 x 76 x 76 1268511
(31) skip 244 x 76 x 76 244 x 76 x 76 -
(32) conv-bn-leaky 244 x 76 x 76 60 x 76 x 76 1283391
(33) conv-bn-leaky 60 x 76 x 76 244 x 76 x 76 1416127
(34) skip 244 x 76 x 76 244 x 76 x 76 -
(35) conv-bn-leaky 244 x 76 x 76 43 x 76 x 76 1426791
(36) conv-bn-leaky 43 x 76 x 76 244 x 76 x 76 1522195
(37) skip 244 x 76 x 76 244 x 76 x 76 -
(38) conv-bn-leaky 244 x 76 x 76 457 x 38 x 38 2527595
(39) conv-bn-leaky 457 x 38 x 38 89 x 38 x 38 2568624
(40) conv-bn-leaky 89 x 38 x 38 457 x 38 x 38 2936509
(41) skip 457 x 38 x 38 457 x 38 x 38 -
(42) conv-bn-leaky 457 x 38 x 38 74 x 38 x 38 2970623
(43) conv-bn-leaky 74 x 38 x 38 457 x 38 x 38 3276813
(44) skip 457 x 38 x 38 457 x 38 x 38 -
(45) conv-bn-leaky 457 x 38 x 38 69 x 38 x 38 3308622
(46) conv-bn-leaky 69 x 38 x 38 457 x 38 x 38 3594247
(47) skip 457 x 38 x 38 457 x 38 x 38 -
(48) conv-bn-leaky 457 x 38 x 38 87 x 38 x 38 3634354
(49) conv-bn-leaky 87 x 38 x 38 457 x 38 x 38 3994013
(50) skip 457 x 38 x 38 457 x 38 x 38 -
(51) conv-bn-leaky 457 x 38 x 38 72 x 38 x 38 4027205
(52) conv-bn-leaky 72 x 38 x 38 457 x 38 x 38 4325169
(53) skip 457 x 38 x 38 457 x 38 x 38 -
(54) conv-bn-leaky 457 x 38 x 38 63 x 38 x 38 4354212
(55) conv-bn-leaky 63 x 38 x 38 457 x 38 x 38 4615159
(56) skip 457 x 38 x 38 457 x 38 x 38 -
(57) conv-bn-leaky 457 x 38 x 38 38 x 38 x 38 4632677
(58) conv-bn-leaky 38 x 38 x 38 457 x 38 x 38 4790799
(59) skip 457 x 38 x 38 457 x 38 x 38 -
(60) conv-bn-leaky 457 x 38 x 38 65 x 38 x 38 4820764
(61) conv-bn-leaky 65 x 38 x 38 457 x 38 x 38 5089937
(62) skip 457 x 38 x 38 457 x 38 x 38 -
(63) conv-bn-leaky 457 x 38 x 38 864 x 19 x 19 8647025
(64) conv-bn-leaky 864 x 19 x 19 91 x 19 x 19 8726013
(65) conv-bn-leaky 91 x 19 x 19 864 x 19 x 19 9437085
(66) skip 864 x 19 x 19 864 x 19 x 19 -
(67) conv-bn-leaky 864 x 19 x 19 53 x 19 x 19 9483089
(68) conv-bn-leaky 53 x 19 x 19 864 x 19 x 19 9898673
(69) skip 864 x 19 x 19 864 x 19 x 19 -
(70) conv-bn-leaky 864 x 19 x 19 52 x 19 x 19 9943809
(71) conv-bn-leaky 52 x 19 x 19 864 x 19 x 19 10351617
(72) skip 864 x 19 x 19 864 x 19 x 19 -
(73) conv-bn-leaky 864 x 19 x 19 63 x 19 x 19 10406301
(74) conv-bn-leaky 63 x 19 x 19 864 x 19 x 19 10899645
(75) skip 864 x 19 x 19 864 x 19 x 19 -
(76) conv-bn-leaky 864 x 19 x 19 11 x 19 x 19 10909193
(77) conv-bn-leaky 11 x 19 x 19 33 x 19 x 19 10912592
(78) conv-bn-leaky 33 x 19 x 19 12 x 19 x 19 10913036
inputDims.d=19,outputDim=19,padding.d[0]=0,stride.d[0]=1 /n(79) maxpool 12 x 19 x 19 12 x 19 x 19 10913036
idx=-2
tensorOutputs.size=79
+idx=77
(80) route - 12 x 19 x 19 10913036
inputDims.d=19,outputDim=19,padding.d[0]=0,stride.d[0]=1 /n(81) maxpool 12 x 19 x 19 12 x 19 x 19 10913036
idx=-4
tensorOutputs.size=81
+idx=77
(82) route - 12 x 19 x 19 10913036
inputDims.d=19,outputDim=19,padding.d[0]=0,stride.d[0]=1 /n(83) maxpool 12 x 19 x 19 12 x 19 x 19 10913036
cont-idx[0]=-1
pos=2
cont-idx[1]=-3
pos=5
cont-idx[2]=-5
pos=8
cont-idx[3]=-6
idx[0]=-1
tensorOutputs.size=83
idx[0]=82
idx[1]=-3
tensorOutputs.size=83
idx[1]=80
idx[2]=-5
tensorOutputs.size=83
idx[2]=78
idx[3]=-6
tensorOutputs.size=83
idx[3]=77
cont=4
(84) route - 48 x 19 x 19 10913036
(85) conv-bn-leaky 48 x 19 x 19 18 x 19 x 19 10913972
(86) conv-bn-leaky 18 x 19 x 19 20 x 19 x 19 10917292
(87) conv-bn-leaky 20 x 19 x 19 12 x 19 x 19 10917580
(88) conv-bn-leaky 12 x 19 x 19 120 x 19 x 19 10931020
(89) conv-linear 120 x 19 x 19 45 x 19 x 19 10936465
(90) yolo 45 x 19 x 19 45 x 19 x 19 10936465
idx=-4
tensorOutputs.size=90
+idx=86
(91) route - 12 x 19 x 19 10936465
(92) conv-bn-leaky 12 x 19 x 19 72 x 19 x 19 10937617
(93) upsample 72 x 19 x 19 72 x 38 x 38 -
cont-idx[0]=-1
pos=2
cont-idx[1]=61
idx[0]=-1
tensorOutputs.size=93
idx[0]=92
idx[1]=61
tensorOutputs.size=93
idx[1]=61
cont=2
(94) route - 529 x 38 x 38 10937617
(95) conv-bn-leaky 529 x 38 x 38 43 x 38 x 38 10960536
(96) conv-bn-leaky 43 x 38 x 38 18 x 38 x 38 10967574
inputDims.d=38,outputDim=38,padding.d[0]=0,stride.d[0]=1 /n(97) maxpool 18 x 38 x 38 18 x 38 x 38 10967574
idx=-2
tensorOutputs.size=97
+idx=95
(98) route - 18 x 38 x 38 10967574
inputDims.d=38,outputDim=38,padding.d[0]=0,stride.d[0]=1 /n(99) maxpool 18 x 38 x 38 18 x 38 x 38 10967574
idx=-4
tensorOutputs.size=99
+idx=95
(100) route - 18 x 38 x 38 10967574
inputDims.d=38,outputDim=38,padding.d[0]=0,stride.d[0]=1 /n(101) maxpool 18 x 38 x 38 18 x 38 x 38 10967574
cont-idx[0]=-1
pos=2
cont-idx[1]=-3
pos=5
cont-idx[2]=-5
pos=8
cont-idx[3]=-6
idx[0]=-1
tensorOutputs.size=101
idx[0]=100
idx[1]=-3
tensorOutputs.size=101
idx[1]=98
idx[2]=-5
tensorOutputs.size=101
idx[2]=96
idx[3]=-6
tensorOutputs.size=101
idx[3]=95
cont=4
(102) route - 72 x 38 x 38 10967574
(103) conv-bn-leaky 72 x 38 x 38 42 x 38 x 38 10970766
(104) conv-bn-leaky 42 x 38 x 38 54 x 38 x 38 10991394
(105) conv-bn-leaky 54 x 38 x 38 23 x 38 x 38 10992728
(106) conv-bn-leaky 23 x 38 x 38 157 x 38 x 38 11025855
(107) conv-linear 157 x 38 x 38 45 x 38 x 38 11032965
(108) yolo 45 x 38 x 38 45 x 38 x 38 11032965
idx=-4
tensorOutputs.size=108
+idx=104
(109) route - 23 x 38 x 38 11032965
(110) conv-bn-leaky 23 x 38 x 38 50 x 38 x 38 11034315
(111) upsample 50 x 38 x 38 50 x 76 x 76 -
cont-idx[0]=-1
pos=2
cont-idx[1]=36
idx[0]=-1
tensorOutputs.size=111
idx[0]=110
idx[1]=36
tensorOutputs.size=111
idx[1]=36
cont=2
(112) route - 294 x 76 x 76 11034315
(113) conv-bn-leaky 294 x 76 x 76 33 x 76 x 76 11044149
(114) conv-bn-leaky 33 x 76 x 76 57 x 76 x 76 11061306
(115) conv-bn-leaky 57 x 76 x 76 15 x 76 x 76 11062221
inputDims.d=76,outputDim=76,padding.d[0]=0,stride.d[0]=1 /n(116) maxpool 15 x 76 x 76 15 x 76 x 76 11062221
idx=-2
tensorOutputs.size=116
+idx=114
(117) route - 15 x 76 x 76 11062221
inputDims.d=76,outputDim=76,padding.d[0]=0,stride.d[0]=1 /n(118) maxpool 15 x 76 x 76 15 x 76 x 76 11062221
idx=-4
tensorOutputs.size=118
+idx=114
(119) route - 15 x 76 x 76 11062221
inputDims.d=76,outputDim=76,padding.d[0]=0,stride.d[0]=1 /n(120) maxpool 15 x 76 x 76 15 x 76 x 76 11062221
cont-idx[0]=-1
pos=2
cont-idx[1]=-3
pos=5
cont-idx[2]=-5
pos=8
cont-idx[3]=-6
idx[0]=-1
tensorOutputs.size=120
idx[0]=119
idx[1]=-3
tensorOutputs.size=120
idx[1]=117
idx[2]=-5
tensorOutputs.size=120
idx[2]=115
idx[3]=-6
tensorOutputs.size=120
idx[3]=114
cont=4
(121) route - 60 x 76 x 76 11062221
(122) conv-bn-leaky 60 x 76 x 76 44 x 76 x 76 11086157
(123) conv-bn-leaky 44 x 76 x 76 41 x 76 x 76 11088125
(124) conv-bn-leaky 41 x 76 x 76 63 x 76 x 76 11111624
(125) conv-linear 63 x 76 x 76 45 x 76 x 76 11114504
(126) yolo 45 x 76 x 76 45 x 76 x 76 11114504
Output blob names :
yolo_90
yolo_108
yolo_126
Total number of layers: 272
Total number of layers on DLA: 0
Building the TensorRT Engine...