-
Notifications
You must be signed in to change notification settings - Fork 40
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
How is the file StyleGAN2-ada-Generator.pth generated? #21
Comments
Hi! Please enter the styleGAN2_ada_model dir and run the following code:
It helps you transform the pkl file into pth file which could be loaded by our code. |
Thank you very much for your answer. I have now encountered a new problem. I used stylegan2-ada-pytorch to train a 10,000-round two-dimensional character model. I used the method you told me to convert pkl into pth. Now I have encountered the model. The file is missing keys. Do you have any solution ideas? I will send you a piece of my training data, and this is my error message: |
Could you please check that if your character model actually contains You can check that by adding |
This is indeed the case. This part of my file: 'mapping.w_avg', 'mapping.fc0.weight', 'mapping.fc0.bias', 'mapping.fc1.weight', 'mapping.fc1.bias']), is different from the part of your StyleGAN2-ada-Generator.pth: 'mapping.w_avg', 'mapping.fc0.weight', 'mapping.fc0.bias', 'mapping.fc1.weight', 'mapping.fc1.bias', 'mapping.fc2.weight', 'mapping.fc2.bias', 'mapping.fc3.weight', 'mapping.fc3.bias', 'mapping.fc4.weight', 'mapping.fc4.bias', 'mapping.fc5.weight', 'mapping.fc5.bias', 'mapping.fc6.weight', 'mapping.fc6.bias', 'mapping.fc7.weight', 'mapping.fc7.bias']).I only have 0-1, you have 0-7 |
Hi, StyleSpace_latent is not used in this project, don't worry. It seems that your mapping network only contains two layers... If you stiil want to use it, you could try to modify
as:
to load your own |
Thank you very much for your answer, I have completed the data generation. I have a question, why do I have only two generated mapping_kwargs, but yours has 7? Did you modify the code? |
I have no idea about it. Maybe it is caused by the config that you used to train stylegan2-ada-pytorch. As you can see here: Btw, the mapping network is used to transform the z latent into w latent. If you lowered the depth of the network from 8 to 2, it might have some influence on forming the w latent space. |
OK, thank you very much for your patient answer. |
When I used stylegan2-ada-pytorch to train, num_layers was indeed 8. I didn't make any changes. I don't know why the generated pkl was 2. The same problem occurred when converting pkl to pth. I thought I would try it first and see the effect. |
I want to ask a question, how is the file StyleGAN2-ada-Generator.pth generated? I have run the stylegan2-ada-pytorch project, and the generated weight file is pkl. If I use pkl directly, it seems not feasible. How can I generate StyleGAN2-ada-Generator.pth with my own data set?
The text was updated successfully, but these errors were encountered: