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

load pretrained weight for Module didn't work #11

Open
Yiru1103 opened this issue Sep 17, 2021 · 1 comment
Open

load pretrained weight for Module didn't work #11

Yiru1103 opened this issue Sep 17, 2021 · 1 comment

Comments

@Yiru1103
Copy link

Hallo,

i want to use the synthesis netzwork to generate the realistic images of dataset Cityscapes using semantic map. but the pretrained weight of the synthesis module didn't match.

hier is the error file:
./synbost-try/image_synthesis/util/util.py

#############################################################
line 227 net.load_state_dict(weights)

*** RuntimeError: Error(s) in loading state_dict for CondConvGenerator:
size mismatch for fc.weight: copying a param with shape torch.Size([32768, 256]) from checkpoint, the shape in current model is torch.Size([1024, 36, 3, 3]).
size mismatch for fc.bias: copying a param with shape torch.Size([32768]) from checkpoint, the shape in current model is torch.Size([1024]).
#############################################################

Do you knwo the reason? I didn't change any other parameters expect the path of checkpoints.

Thank you for your help.

Best Regards
Yiru

@ah-ke
Copy link

ah-ke commented Oct 29, 2022

Hallo,

i want to use the synthesis netzwork to generate the realistic images of dataset Cityscapes using semantic map. but the pretrained weight of the synthesis module didn't match.

hier is the error file: ./synbost-try/image_synthesis/util/util.py

############################################################# line 227 net.load_state_dict(weights)

*** RuntimeError: Error(s) in loading state_dict for CondConvGenerator: size mismatch for fc.weight: copying a param with shape torch.Size([32768, 256]) from checkpoint, the shape in current model is torch.Size([1024, 36, 3, 3]). size mismatch for fc.bias: copying a param with shape torch.Size([32768]) from checkpoint, the shape in current model is torch.Size([1024]). #############################################################

Do you knwo the reason? I didn't change any other parameters expect the path of checkpoints.

Thank you for your help.

Best Regards Yiru

use_vae set True

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

2 participants