-
Notifications
You must be signed in to change notification settings - Fork 147
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 to save the pkl file from colab? #42
Comments
The .pt models are pytorch checkpoints, they'll work with rosinality's stylegan2 code but not with the official implementations. If you're working with SG3, you should just save the model as we do in this if block. This produces a pkl checkpoint that you can then use with the official SG3 code. |
when i try to use the generated pkl in stylegan3 it gives me an error (it only exports the save_intervals, not the actual trained model (training_iterations))
|
What StyleGAN3 script are you trying to run? If it's one of the generation scripts, could you try to change the loading code from:
to:
and let me know if that works? |
that worked, thanks! |
Glad to hear. Closing the issue. Feel free to re-open or open a new issue if you need more help. |
it seems like the colab only saves the previous save_interval, for example if i put the number of save_interval on for example 400 and training_iterations on 800 it only seems to save 000400.pkl and not 000800.pkl, how do i fix this? the model definitely exists somewhere because i can generate pictures with it but it doesn't appear anywhere |
Set the training_iterations to 801 and it should work get you that last checkpoint |
i'm using this colab repo
the new pkl file should end up in the checkpoints folder right?
or do i have to add some particular lines of code?
https://github.com/rinongal/StyleGAN-nada/blob/StyleGAN3-NADA/stylegan3_nada.ipynb
edit:
found the code but it doesn't work in the normal stylegan, is that right? and if so, how do i use it after generating?
i also found out how to get the .pkl files with the save_interval but those don't work with the normal stylegan either
model_name = "network-snapshot-011120.pt"
torch.save(
{
"g_ema": net.generator_trainable.generator.state_dict(),
"g_optim": g_optim.state_dict(),
},
f"{ckpt_dir}/{model_name}",
)
!ls /content/output/checkpoint
is there any way to convert the file into a normal stylegan model again like this repo states it can convert a stylegan2-nada.pt to stylegan2.pkl so maybe this is possible for stylegan3?
https://github.com/eps696/stylegan2ada
all my pictures are slightly tilted to the left and i normally use the visualizer to fix that but it doesnt work with these files :(
The text was updated successfully, but these errors were encountered: