There are some issues in your code:


self.base doesn’t have any non-linearities, so you should add e.g. nn.ReLU() between the layers

self.base outputs an activation of shape [batch_size, 4], so out_labels and out_bbox should have in_features=4


x is defined as an empty tuple. Initialize it as a random tensor (as shown in my example code) or use your data tensors instead.