Output with shape doesn't match the broadcasting shape
I am performing transfer learning with centermask for my custom dataset. Using the trim_model script, I have reinitialized the following layers: cls_score = nn.Linear(num_inputs, num_classes) bbox_pred = nn.Linear(num_inputs, num_bbox_reg_classes * 4) mask_fcn_logits = nn.Conv2d(dim_reduced, num_classes, 1, 1, 0) cls_logits = nn.Conv2d(dim_reduced, num_classes-1, 3, 3, 0) conv5_mask = nn.ConvTranspose2d(dim_reduced, dim_reduced, 2, 2, 0)
newdict['model']['module.roi_heads.box.predictor.cls_score.weight'] = cls_score.weight newdict['model']['module.roi_heads.box.predictor.cls_score.bias'] = cls_score.bias
newdict['model']['module.roi_heads.maskiou.predictor.maskiou.weight'] = cls_score.weight newdict['model']['module.roi_heads.maskiou.predictor.maskiou.bias'] = cls_score.bias
newdict['model']['module.roi_heads.box.predictor.bbox_pred.weight'] = bbox_pred.weight newdict['model']['module.roi_heads.box.predictor.bbox_pred.bias'] = bbox_pred.bias
newdict['model']['module.roi_heads.mask.predictor.mask_fcn_logits.weight'] = mask_fcn_logits.weight newdict['model']['module.roi_heads.mask.predictor.mask_fcn_logits.bias'] = mask_fcn_logits.bias
newdict['model']['module.rpn.head.cls_logits.weight'] = cls_logits.weight newdict['model']['module.rpn.head.cls_logits.bias'] = cls_logits.bias
newdict['model']['module.roi_heads.mask.predictor.conv5_mask.weight'] = conv5_mask.weight newdict['model']['module.roi_heads.mask.predictor.conv5_mask.bias'] = conv5_mask.bias
After doing these, and on training, I am getting the following error:
Traceback (most recent call last):
File "train_net.py", line 189, in
I am training for single class detection, but don't know how 80 suddenly popped up. Any help would be appreciated. Thank you