Open chilldenaya opened 1 year ago
I attempted to include a conditional statement within the __init__
method of BackboneBase_VGG
class as follows:
elif name == "vgg11_bn":
self.body1 = nn.Sequential(*features[:7])
self.body2 = nn.Sequential(*features[7:14])
self.body3 = nn.Sequential(*features[14:21])
self.body4 = nn.Sequential(*features[21:28])
However, I encountered another error that was similar in nature.
RuntimeError: Error(s) in loading state_dict for P2PNet:
Missing key(s) in state_dict: "backbone.body1.5.weight", "backbone.body1.5.bias", "backbone.body1.5.running_mean", "backbone.body1.5.running_var".
Unexpected key(s) in state_dict: "backbone.body1.7.weight", "backbone.body1.7.bias", "backbone.body1.8.weight", "backbone.body1.8.bias", "backbone.body1.8.running_mean", "backbone.body1.8.running_var", "backbone.body1.8.num_batches_tracked", "backbone.body1.10.weight", "backbone.body1.10.bias", "backbone.body1.11.weight", "backbone.body1.11.bias", "backbone.body1.11.running_mean", "backbone.body1.11.running_var", "backbone.body1.11.num_batches_tracked", "backbone.body1.3.weight", "backbone.body1.3.bias", "backbone.body1.4.running_mean", "backbone.body1.4.running_var", "backbone.body1.4.num_batches_tracked", "backbone.body2.7.weight", "backbone.body2.7.bias", "backbone.body2.8.weight", "backbone.body2.8.bias", "backbone.body2.8.running_mean", "backbone.body2.8.running_var", "backbone.body2.8.num_batches_tracked", "backbone.body3.7.weight", "backbone.body3.7.bias", "backbone.body3.8.weight", "backbone.body3.8.bias", "backbone.body3.8.running_mean", "backbone.body3.8.running_var", "backbone.body3.8.num_batches_tracked", "backbone.body4.7.weight", "backbone.body4.7.bias", "backbone.body4.8.weight", "backbone.body4.8.bias", "backbone.body4.8.running_mean", "backbone.body4.8.running_var", "backbone.body4.8.num_batches_tracked".
size mismatch for backbone.body1.4.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128, 64, 3, 3]).
size mismatch for backbone.body1.4.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
Can vgg11_bn be used instead of vgg16_bn in the code?
I attempted to change the model to the pre-trained vgg11_bn model provided by PyTorch, but I encountered an error. The error message states that some keys are missing in the state_dict for the P2PNet model, such as backbone.body1.5.weight, backbone.body1.5.bias, backbone.body1.5.running_mean, backbone.body1.5.running_var, and many others. In addition, there are unexpected keys in the state_dict, such as backbone.body1.10.weight, backbone.body1.10.bias, backbone.body1.11.weight, backbone.body1.11.bias, and so on. There is also a size mismatch for some of the parameters, such as backbone.body1.4.weight and backbone.body1.4.bias.
I found this error:
I would greatly appreciate any response. Thank you!