omertov / encoder4editing

Official implementation of "Designing an Encoder for StyleGAN Image Manipulation" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02766
MIT License
945 stars 154 forks source link

StyleGAN2-ada-pytorch models supported? #4

Closed TheodoreGalanos closed 3 years ago

TheodoreGalanos commented 3 years ago

Hello and thanks for sharing your code!

I am trying to train an encoder on a stylegan2-ada-pytorch model that I have pretrained. I am using a .pkl file (as is the default output of that repo) and I am getting errors (related to the ada repo in fact). Is it possible to use that model here, or do I need to convert it somehow?

Thanks in advance!

omertov commented 3 years ago

Hi @TheodoreGalanos! This repository uses the stylegan2 implementation by rosinality: https://github.com/rosinality/stylegan2-pytorch. To load your trained model you will need to first convert it into a checkpoint compatible with the above repository.

(From a quick glance I saw a relevant issue in stylegan2-ada-pytorch, after which the convert_weight.py script from the rosinality repository can be used)

TheodoreGalanos commented 3 years ago

Thanks just saw that too, would be great. Really want to use your implementation!

omertov commented 3 years ago

For future reference, it seems like there is a way for converting the stylegan2-ada-pytorch model: https://github.com/rosinality/stylegan2-pytorch/issues/206.

Feel free to reopen the issue in case the suggested solution does not work :)