You could try using the ROIPooling implementation from https://github.com/longcw/faster_rcnn_pytorch/tree/master/faster_rcnn/roi_pooling
Note that implementing ROIPooling in pytorch can be very easily done with existing layers (even though it won’t be as efficient as the implementation from above), an example can be found in https://github.com/pytorch/examples/blob/d8d378c31d2766009db400ac03f41dd837a56c2a/fast_rcnn/roi_pooling.py#L38-L53 , where adaptive_max_pool
was recently merged into master.