NVlabs / stylegan3

Official PyTorch implementation of StyleGAN3
Other
6.3k stars 1.11k forks source link

Load pretrain with different resolution #195

Open EnricoBeltramo opened 1 year ago

EnricoBeltramo commented 1 year ago

I have a pretrained model in 512x512, there are some trick to load it and start a new training at 256x256?

youssefadarrab commented 1 year ago

Hello ! I have managed to train a model at 1024x1024 resolution from a 512x384 checkpoint using this repository https://github.com/aydao/stylegan2-surgery.

You can use their scripts as they describe in the following: "create_initial_network_pkl.py Drops a refreshly initialized, untrained StyleGAN pkl of the appropriate size. You can use this script to create a pkl of a desired resolution, making it ideal to use in conjunction with copy_weights.py as a target pkl".

All you have to do is to initialize a checkpoint at 256x256, then copy the weights from yout 512x512 checkpoint into the newly initialized 256x256 pkl checkpoint.