I did have a thought.
The images are quite large, and at the moment I’m having the Mask RCNN model perform resizing through the GeneralizedRCNNTransform that gets called through forward() line 130. Could it be that forward is not getting called in the inference step and so the resizing isn’t occuring and so they are going in at full size (3600*5100) therefore OOM?
Im relativetly new to PyTorch and so don’t fully understand the use of every function and im not sure if forward is only used in training or what.