Hello, I am trying to add an extra layer to the backbone of the Faster RCNN model (ResNet 50) but I am having trouble with the tensor shapes if anyone can help me. The code is as below, and I am trying to determine the meta_array_shape and backbone_output_shape variables. The first one is regarding the 2nd input which is a tensor of 3 columns, while the second is trying to match the output of the backbone so that they can be concatenated together.
The backbone_output_shape = (512,3) determines 512 as batch_size and 3 as output.
The meta_in should be (512, ?), so batch_size should be the same and then:
Sorry, meta_in is the 2nd input tensor I mentioned above which has 3 columns. The backbone_output_shape is the original output of the faster rcnn model backbone which I am not sure how to obtain
def forward(self, images_in, meta_in):
X = self.faster_rcnn.transform(images_in)
X = self.faster_rcnn.backbone(X)
Y = self.meta_model(meta_in)
X = torch.cat(X, Y)
....
return X