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

Stylegan2-ada and GANSpace #21

Open
100330706 opened this issue Nov 4, 2020 · 5 comments
Open

Stylegan2-ada and GANSpace #21

100330706 opened this issue Nov 4, 2020 · 5 comments

Comments

@100330706
Copy link

Does this code works for stylegan2-ada?

@harskish
Copy link
Owner

harskish commented Nov 9, 2020

Getting stylegan2-ada checkpoints to load probably requires some extra work.
First of all, if the checkpoints are from TensorFlow, then they need to be converted to PyTorch. The conversion needs to be done with https://github.com/rosinality/stylegan2-pytorch, and if that repo doesn't support converting sg2-ada checkpoints, then that functionality needs to be added.
Further, GANSpace uses a fork of the aforementioned repo, so any relevant changes need to be added to the fork (https://github.com/harskish/stylegan2-pytorch).

I'd be happy to accept a pull request if anyone gets this working!

@100330706
Copy link
Author

Hello! At the end I managed the code to work just by changing the repo path when converting the weights to pytorch weights:

python /content/ganspace/models/stylegan2/stylegan2-pytorch/convert_weight.py --repo="path/to/the/stylegan2-ada/repo" "tensorflow_pkl"

Once weights are converted GANSpace works fine. I just had to change a couple of paths to make it work within Colab.

@Mohamed209
Copy link

got this issue while converting stylegan2ada model trained with continue training from ffhq256 on custom dataset
KeyError: 'G_mapping/Dense2/weight'
this is true as weights dict has no such layer

@Mohamed209
Copy link

I solved the issue by converting with the original torch2stylegan repo not the fork included in your repo
Thanks

@Brainerd95
Copy link

got this issue while converting stylegan2ada model trained with continue training from ffhq256 on custom dataset KeyError: 'G_mapping/Dense2/weight' this is true as weights dict has no such layer

I get the exact same error (using the official stylegan2-ada repo as suggested above)

I solved the issue by converting with the original torch2stylegan repo not the fork included in your repo Thanks

Can you specify which exact repo you used for that?

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

4 participants