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(s) in loading state_dict for Generator: #2

Open
askasjoe opened this issue Feb 25, 2022 · 7 comments
Open

Error(s) in loading state_dict for Generator: #2

askasjoe opened this issue Feb 25, 2022 · 7 comments

Comments

@askasjoe
Copy link

askasjoe commented Feb 25, 2022

image
seems no 'g_ema' layer in model.py? any suggestions? thanks~

@askasjoe
Copy link
Author

image

@r1cebank
Copy link
Member

r1cebank commented Mar 7, 2022

Sorry for the late reply, are you training or trying to run trained checkpoints? Can you share more info?

@askasjoe
Copy link
Author

askasjoe commented Mar 10, 2022

Sorry for the late reply, are you training or trying to run trained checkpoints? Can you share more info?

yea~ i was doing the inference python generate.py --size 512 --ckpt checkpoint/790000.pt using the the ckpt file checkpoints_790000_v1.zip from here https://github.com/diva-eng/stylegan-waifu-generator/releases/ and met the RuntimeError mentioned above, thanks~

@r1cebank
Copy link
Member

could you try again with the load_state_dict line replaced with g_ema.load_state_dict(checkpoint["g_ema"], strict=False). sorry I dont have the machine I did the training and getting this to run on my current windows system is a pain 😢

@askasjoe
Copy link
Author

this way worked, thank you very much~ even though the color style looks a bit weird
image

@r1cebank
Copy link
Member

Glad to hear it worked, the color problem is probably due to the g_ema layer issue😓, if I found a way to make it work I’ll let you know.

@askasjoe
Copy link
Author

Glad to hear it worked, the color problem is probably due to the g_ema layer issuesweat, if I found a way to make it work I’ll let you know.

got it~ thank you very much 😊

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