Open ou525 opened 4 years ago
What padding SAME or VALID do you use? How did you convert it?
@AlexeyAB My setup code is as follows, and did not set the same or valid nvinfer1::IPoolingLayer pool = network->addPooling(input, nvinfer1::PoolingType::kMAX, nvinfer1::DimsHW{size, size}); assert(pool); std::string maxpoolLayerName = "maxpool_" + std::to_string(layerIdx); pool->setStride(nvinfer1::DimsHW{stride, stride}); pool->setPadding(nvinfer1::DimsHW{(size-1)/2, (size-1)/2});
@AlexeyAB Sorry, continue to disturb.Sorry, continue to disturb. I found that there were mainly some false detections of small targets, so I suspect that the maxpool layer of the spp module is not delivered correctly.
Try to use https://github.com/wang-xinyu/tensorrtx It supports both yolov3-spp and yolov4
I have read and referred to this code, it is based on the implementation of pytorch, so the implementation of maxpool is still different from darknet.
@AlexeyAB Thank you for your work, I encountered a problem When I converted to the tensorrt model, I found that the darknet maxpool layer implementation is l-> out_w = (w + l-> pad-l-> size) / l-> stride_x + 1, but other frameworks are l-> out_w = (w + 2 * l-> pad-l-> size) / l-> stride_x + 1. Now the results of these two tests are different, mainly reflected in small targets.