Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using pretrained model to train styleunet #37

Open
Onlybyuse opened this issue Sep 11, 2023 · 0 comments
Open

Error when using pretrained model to train styleunet #37

Onlybyuse opened this issue Sep 11, 2023 · 0 comments

Comments

@Onlybyuse
Copy link

Hello, when training the styleunet of model 3 in-the-wild dataset, i use the pretrained model of model 1 with discriminator (face-superresolution) as you suggested (the training of styleunet can start with the pretrained model 1 with discriminator above). But got the the following error

Error(s) in loading state_dict for StyleUNet: size mismatch for from_rgbs.0.conv.0.weight: copying a param with shape torch.Size([32, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([128, 12, 1, 1]). size mismatch for from_rgbs.0.conv.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for from_rgbs.1.conv.0.weight: copying a param with shape torch.Size([256, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 12, 1, 1]). size mismatch for from_rgbs.1.conv.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for cond_convs.0.conv1.0.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]). size mismatch for cond_convs.0.conv1.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for cond_convs.0.conv2.1.weight: copying a param with shape torch.Size([256, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 128, 3, 3]). size mismatch for cond_convs.0.conv2.1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for cond_convs.1.conv1.0.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). size mismatch for cond_convs.1.conv1.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for cond_convs.1.conv2.1.weight: copying a param with shape torch.Size([512, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). size mismatch for comb_convs.0.0.weight: copying a param with shape torch.Size([256, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1024, 3, 3]). size mismatch for comb_convs.0.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for comb_convs.2.0.weight: copying a param with shape torch.Size([512, 1024, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). File "/data4/y00028864/code_project/StyleAvatar/styleunet/train.py", line 325, in <module> generator.load_state_dict(ckpt["g"], strict=False) RuntimeError: Error(s) in loading state_dict for StyleUNet: size mismatch for from_rgbs.0.conv.0.weight: copying a param with shape torch.Size([32, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([128, 12, 1, 1]). size mismatch for from_rgbs.0.conv.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for from_rgbs.1.conv.0.weight: copying a param with shape torch.Size([256, 12, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 12, 1, 1]). size mismatch for from_rgbs.1.conv.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for cond_convs.0.conv1.0.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]). size mismatch for cond_convs.0.conv1.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for cond_convs.0.conv2.1.weight: copying a param with shape torch.Size([256, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 128, 3, 3]). size mismatch for cond_convs.0.conv2.1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for cond_convs.1.conv1.0.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). size mismatch for cond_convs.1.conv1.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for cond_convs.1.conv2.1.weight: copying a param with shape torch.Size([512, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). size mismatch for comb_convs.0.0.weight: copying a param with shape torch.Size([256, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1024, 3, 3]). size mismatch for comb_convs.0.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for comb_convs.2.0.weight: copying a param with shape torch.Size([512, 1024, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]).

The mismatch error. Did I understand your words wrong? THX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant