I am trying to use the pretrained Mask RCNN model directly from PyTorch. However, I would like to separate the backbone part from the RPN and the head part, i.e, I want to create two models from the initial model. I have seen many people ask this but, could not find a solution:
If I divide the model using
modules = list(model.children()) and try to create an
nn.Sequential() using this, I get this error:
TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not tuple.
Some people also faced this issue, but I couldn’t solve this. Some examples are:
The problem is caused due to the GeneralizedRCNNTransform() returning an
Would be grateful for any kind of hints/help.
Thanks in advance.