Hello,
I am new to pytorch and I wanted to try different backbones for FasterRCNN. I am following this tutorial: https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html#defining-your-model
This is my model
def my_model(num_classes):
backboneV3= torchvision.models.inception_v3(pretrained=False)
backboneV3_nofc = nn.Sequential(*list(backboneV3.children())[:-1])
backboneV3_nofc.out_channels = 192
anchor_generator = AnchorGenerator(sizes=((32, 64, 128, 256, 512),),
aspect_ratios=((0.5, 1.0, 2.0),))
roi_pooler = torchvision.ops.MultiScaleRoIAlign(featmap_names=[0],
output_size=7,
sampling_ratio=2)
modelV3 = FasterRCNN(backboneV3_nofc,
num_classes=num_classes,
rpn_anchor_generator=anchor_generator,
box_roi_pool=roi_pooler)
return modelV3
I give the data during training exactly as in the tutorial but I always get this error:
RuntimeError: Expected 4-dimensional input for 4-dimensional weight 192 768, but got 2-dimensional input of size [2, 1000] instead
What should I change in the model?