irfanICMLL / structure_knowledge_distillation

The official code for the paper 'Structured Knowledge Distillation for Semantic Segmentation'. (CVPR 2019 ORAL) and extension to other tasks.
BSD 2-Clause "Simplified" License
702 stars 104 forks source link

Could you please provide the resnet18(edited) imagenet-pretrain? #20

Closed jankyee closed 4 years ago

jankyee commented 4 years ago

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

irfanICMLL commented 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.

jankyee commented 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.

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."

irfanICMLL commented 4 years ago

You will get similar results. See the network structure in the branch CVPR2019.

lmunan commented 4 years ago

@Jankyee I also encountered this problem, can you tell me where to change it?