harskish / ganspace

Discovering Interpretable GAN Controls [NeurIPS 2020]
Apache License 2.0
1.78k stars 264 forks source link

Google colab - When running cell to convert tensorflow model to pytorch model, I get an error #44

Open Randy-H0 opened 3 years ago

Randy-H0 commented 3 years ago
Traceback (most recent call last):
  File "/content/ganspace/models/stylegan2/stylegan2-pytorch/convert_weight.py", line 221, in <module>
    generator, discriminator, g_ema = pickle.load(f)
  File "/content/stylegan2/dnnlib/tflib/network.py", line 278, in __setstate__
    assert state["version"] in [2, 3, 4]
AssertionError

This is the error I am getting. Any help?

mctrinkle commented 3 years ago

Are you using a model from Stylgan2-Ada? I have at some point got that error while using google colab, but the solution was nothing to do with colab.

Randy-H0 commented 3 years ago

Are you using a model from Stylgan2-Ada? I have at some point got that error while using google colab, but the solution was nothing to do with colab.

Sorry that I am late. Yes, I am using a Stylegan2-Ada model.

mctrinkle commented 3 years ago

What params and functions are you using? I was able to get my Stylegan2-ada model to work using the advice of https://github.com/harskish/ganspace/issues/21 Have you tried that?

Randy-H0 commented 3 years ago

What params and functions are you using? I was able to get my Stylegan2-ada model to work using the advice of #21 Have you tried that?

I left it all at default and when running the cell "!python /content/ganspace/models/stylegan2/stylegan2-pytorch/convert_weight.py --repo="/content/stylegan2/" "/content/ffhq.pkl" #convert weights"

Randy-H0 commented 3 years ago

What params and functions are you using? I was able to get my Stylegan2-ada model to work using the advice of #21 Have you tried that?

Hi, I have checked out the issue and it did not solve anything, I still can't convert my model and I still get this error image

mctrinkle commented 3 years ago

Please try the advice suggested in https://github.com/harskish/ganspace/issues/21 python /content/ganspace/models/stylegan2/stylegan2-pytorch/convert_weight.py --repo="path/to/the/stylegan2-ada/repo" "tensorflow_pkl" Have you tried that?

Randy-H0 commented 3 years ago

Please try the advice suggested in #21 python /content/ganspace/models/stylegan2/stylegan2-pytorch/convert_weight.py --repo="path/to/the/stylegan2-ada/repo" "tensorflow_pkl" Have you tried that?

I have multiple times but I think I found the problem. My model is Stylegan2-ada, but I am using the Stylegan2 model converter. I think that might me the problem. Is there any way I can do this using the Stylegan2 model converter or is there any model converter that does convert stylegan2-ada succesfully?

Thanks!

Randy-H0 commented 3 years ago

Please try the advice suggested in #21 python /content/ganspace/models/stylegan2/stylegan2-pytorch/convert_weight.py --repo="path/to/the/stylegan2-ada/repo" "tensorflow_pkl" Have you tried that?

I have multiple times but I think I found the problem. My model is Stylegan2-ada, but I am using the Stylegan2 model converter. I think that might me the problem. Is there any way I can do this using the Stylegan2 model converter or is there any model converter that does convert stylegan2-ada succesfully?

Thanks!

Oh and not to forget, I did find a Stylegan2-ada-pytorch repo but it doesn't convert weights