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

Using another pretrained StyleGAN2 #35

Closed
JbIPS opened this issue Jun 1, 2022 · 2 comments
Closed

Using another pretrained StyleGAN2 #35

JbIPS opened this issue Jun 1, 2022 · 2 comments

Comments

@JbIPS
Copy link

JbIPS commented Jun 1, 2022

Hi,

I'm playing with your notebook (awesome work btw!) and I try to give it another pretrained GAN from Awesome Pretrained StyleGAN2.

I used the anime one (PyTorch implementation from here) but I get

TypeError                                 Traceback (most recent call last)

[<ipython-input-10-2395bdddca96>](https://localhost:8080/#) in <module>()
     22 
     23 #print(ckpt)
---> 24 generator.load_state_dict(ckpt["g"], strict=False)
     25 
     26 #@title Generate results

TypeError: 'Generator' object is not subscriptable

Do I need further operation on the model to make it compatible?

Thank you

@mchong6
Copy link
Owner

mchong6 commented Jun 2, 2022

Maybe the pretrained model is trained using the official stylegan2 repo. The repo I built upon is by rosalinity. To make it compatible you have to convert the model file to one that is compatible with this repo. Look at the readme of the rosalinity repo to see how to do that.

@JbIPS
Copy link
Author

JbIPS commented Jun 2, 2022

My bad, it looks like my file only contains the structure of the network, not the saved weights

@JbIPS JbIPS closed this as completed Jun 2, 2022
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