semantic-segmentation-pytorch
semantic-segmentation-pytorch copied to clipboard
Runtime error: size mismatch
Hi, I'm running the google colab provided in README, and I want to subtitude the model to HRNetv2. I download the weights file for encoder and decoder from the link provided in README, and modify the net_encoder and net_decoder weights in the colab, but encounter some error. Here is the error message, do I need to modify anything else?
Loading weights for net_encoder
RuntimeError Traceback (most recent call last)
1 frames /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict) 1222 if len(error_msgs) > 0: 1223 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( -> 1224 self.class.name, "\n\t".join(error_msgs))) 1225 return _IncompatibleKeys(missing_keys, unexpected_keys) 1226
RuntimeError: Error(s) in loading state_dict for ResnetDilated: size mismatch for layer1.0.conv1.weight: copying a param with shape torch.Size([64, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([64, 128, 1, 1]). size mismatch for layer1.0.downsample.0.weight: copying a param with shape torch.Size([256, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 128, 1, 1]).