ptrblck:

model.load_state_dict(torch.load(PATH)) m


Thanks. I have an error

RuntimeError: While copying the parameter named conv_class.weight, whose dimensions in the model are torch.Size([4, 50, 1, 1]) and whose dimensions in the checkpoint are torch.Size([2, 50, 1, 1]).

This is my complete code
        checkpoint_dict = torch.load('./10000_model.pth')
        pretrained_dict = checkpoint_dict['state_dict']
        model.load_state_dict(pretrained_dict)
        num_ftrs = model.conv_classify.in_features
        model.conv_classify= nn.Conv2d(num_ftrs, 4, kernel_size=1, padding=0)