Hello,
I would like to load the weights of the densenet121 network like that :
net = models.densenet121(pretrained=False)
net.load_state_dict(torch.load(’./densenet121-a639ec97.pth’))
it return me this error :
RuntimeError: Error(s) in loading state_dict for DenseNet:
Missing key(s) in state_dict: “features.denseblock1.denselayer1.norm1.weight”, “features.denseblock1.denselayer1.norm1.bias”, “features.denseblock1.denselayer1.norm1.running_mean”, “features.denseblock1.denselayer1.norm1.running_var”, “features.denseblock1.denselayer1.conv1.weight”, “features.denseblock1.denselayer1.norm2.weight”, “features.denseblock1.denselayer1.norm2.bias”, “features.denseblock1.denselayer1.norm2.running_mean”, “features.denseblock1.denselayer1.norm2.running_var”, “features.denseblock1.denselayer1.conv2.weight”
etc…
…
I use this method instead of :
net = models.densenet121(pretrained=True)
because the proxy of my company don’t allow to do it…
Could someone help me ?
Thank you