RuntimeError: Error(s) in loading state_dict for HRNet:
size mismatch for final_layer.weight: copying a param with shape torch.Size([17, 48, 1, 1]) from checkpoint, the shape in current model is torch.Size([5, 48, 1, 1]).
size mismatch for final_layer.bias: copying a param with shape torch.Size([17]) from checkpoint, the shape in current model is torch.Size([5]).
During transfer learning with a pretrained model, I received an error that the output layer stored in the check point is 17 by default and the number of keypoints I want to detect is 5, so it is different.
The error doesn't go away even with strict=False. What should I do?
Hi @HanSeulChung , apologies for the late reply.
Setting the parameter nof_joints to 5 should solve the issue, please comment and reopen the issue if that doesn't work.
RuntimeError: Error(s) in loading state_dict for HRNet: size mismatch for final_layer.weight: copying a param with shape torch.Size([17, 48, 1, 1]) from checkpoint, the shape in current model is torch.Size([5, 48, 1, 1]). size mismatch for final_layer.bias: copying a param with shape torch.Size([17]) from checkpoint, the shape in current model is torch.Size([5]).
During transfer learning with a pretrained model, I received an error that the output layer stored in the check point is 17 by default and the number of keypoints I want to detect is 5, so it is different. The error doesn't go away even with strict=False. What should I do?