ganspace icon indicating copy to clipboard operation
ganspace copied to clipboard

Stylegan2-ada and GANSpace

Open 100330706 opened this issue 3 years ago • 5 comments

Does this code works for stylegan2-ada?

100330706 avatar Nov 04 '20 22:11 100330706

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!

harskish avatar Nov 09 '20 11:11 harskish

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.

100330706 avatar Nov 09 '20 11:11 100330706

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 avatar Feb 16 '21 13:02 Mohamed209

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

Mohamed209 avatar Feb 27 '21 23:02 Mohamed209

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?

Brainerd95 avatar Apr 17 '22 12:04 Brainerd95