Closed jankyee closed 4 years ago
For the new version, we just initialize the network with the pretrain model(https://download.pytorch.org/models/resnet18-5c106cde.pth) (except the different layers.) For the cvpr version, the resnet18 still has the conv1-77.
For the new version, we just initialize the network with the pretrain model(https://download.pytorch.org/models/resnet18-5c106cde.pth) (except the different layers.) For the cvpr version, the resnet18 still has the conv1-77.
You mean setting strict=False when load the pretrain? I tried and failed, showing
"RuntimeError: Error(s) in loading state_dict for ResNet: size mismatch for conv1.weight: copying a param of torch.Size([64, 3, 3, 3]) from checkpoint, where the shape is torch.Size([64, 3, 7, 7]) in current model. size mismatch for layer1.0.conv1.weight: copying a param of torch.Size([64, 128, 3, 3]) from checkpoint, where the shape is torch.Size([64, 64, 3, 3]) in current model."
You will get similar results. See the network structure in the branch CVPR2019.
@Jankyee I also encountered this problem, can you tell me where to change it?
HI. I find that in your codes, the resnet backbone is not same as pytorch official version, that is, the conv1-7*7 is replaced with 3*3*3. So I could not load the resnet18 imagenet pretrain model(https://download.pytorch.org/models/resnet18-5c106cde.pth). Could you please provide your resnet18 imagenet-pretrain ckpt? Thx