Conversion of weights from Tensorflow to Pytorch

#1
by aravind011 - opened

Hi, could I ask how did you manage to convert the Model's weights from Tensorflow to Pytorch using rosinality/stylegan2-pytorch. I am getting errors in loading the state_dict for the Generator due to the mismatch in input tensor sizes. Thank you for taking the time to reply.

Hi, aravind011

The architecture of the TADNE model is slightly different from that of the standard StyleGAN2, so you need to apply a patch to https://github.com/rosinality/stylegan2-pytorch.
As you asked and the license of the TADNE model is CC-0, I've just made my TADNE model repo on Hugging Face public. The converted model is in the models directory and the README describes how to convert the model.

Thank you very much for the patch. I have applied the patch to both model and convert_weights files and the conversion worked. The files are available at this link https://drive.google.com/uc?export=download&id=1iSvKS71QpqX2ojSEA72PLh1hWP_dsm89. Again very much appreciated for help and demo, closing the issue now.

aravind011 changed discussion status to closed

Sign up or log in to comment