DeepLabV3Plus-Pytorch
DeepLabV3Plus-Pytorch copied to clipboard
load pretrained model error
RuntimeError: Error(s) in loading state_dict for DeepLabV3: size mismatch for classifier.classifier.3.weight: copying a param with shape torch.Size([21, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([3, 256, 1, 1]). size mismatch for classifier.classifier.3.bias: copying a param with shape torch.Size([21]) from checkpoint, the shape in current model is torch.Size([3]).
I think this error means that your setting of "num_classes" isn't match with the trained weight.your datasets have three class,but the trained weight has 21 weight.try to replace the num_classes to 21i in the predict,best wishes!