Transfer the ROI Pooling layer through uff in tensorRT


I have some problems when implementing my own roi pooling layer in TensorRT.
Dimension errors will occur when the 5-dimensional output(N,B,C,H,W)of ROI Pooling layer is connected to the convolution layer.

My guess is that the output of the TensorRT custom plugin will automatically add a batch size dimension. For example, ROI Pooling output 100 boxes [100, C, H, W], the output of custom plugin is [batch, 100, C, H, W], However, 100 boxes are counted as batch in the convolution layer behind, so there is an extra dimension.

I don’t know how to change the batch size after roi pooling layer before feeding the tensor to the convlution or fully connection layers.

the getOutputDimension of roi pooling layer is NCHW.Dims

getOutputDimensions(int index, const Dims* inputs, int nbInputDims){

return DimsNCHW(roi_batch, channels, height, width);

But is seems not work, The batch size of next conv layer is still only have batchSize=1.

I have no idea about changing the batch size after the plugin layer.

And advise?


@ Nvidia developer

please help me about the above questions.