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

Convert class conditional models(stylegan2-ada pytorch) to genforce format? #39

Open
waleedrazakhan92 opened this issue Mar 16, 2023 · 2 comments

Comments

@waleedrazakhan92
Copy link

I'm trying to convert stylegan2-ada pytorch version into genforce format. The ones that are not conditional are converted without any error but when there is a conditional model, i get this error assert tf_var_name in official_tf_to_pth_var_mapping AssertionError. Which i believe tells that some of the mappings are not found in the model. Can you please tell if the class conditional models are supported or not. Or what else could be the problem. I'm using cifar10 model file for now. And I've also tested with one of the conditional model on faces that i've trained. Both give the same error.

@loopback-kr
Copy link

You can use converter

@bridenmj
Copy link

bridenmj commented May 5, 2023

Just to follow up. I had the same issue. In stylegan2ada_pth_converter.py, I tracked the issue to:

    G = build_model(gan_type=GAN_TPYE,
                    module='generator',
                    resolution=resolution,
                    z_space_dim=z_space_dim,
                    w_space_dim=w_space_dim,
                    label_size=label_size,
                    repeat_w=repeat_w,
                    image_channels=image_channels)
    G_state_dict = G.state_dict()
  

I had to pass more parameters to build_model to correctly build the StyleGAN2Generator, the code for which is in stylegan2_generator.py. In my case, my mapping network had 2 layers but the default is 8.

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

3 participants