ganspace icon indicating copy to clipboard operation
ganspace copied to clipboard

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

Open Randy-H0 opened this issue 4 years ago • 8 comments

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?

Randy-H0 avatar Mar 19 '21 13:03 Randy-H0

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.

mctrinkle avatar Mar 19 '21 18:03 mctrinkle

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.

Randy-H0 avatar Mar 21 '21 16:03 Randy-H0

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?

mctrinkle avatar Mar 23 '21 13:03 mctrinkle

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 avatar Mar 23 '21 15:03 Randy-H0

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

Randy-H0 avatar Mar 30 '21 18:03 Randy-H0

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?

mctrinkle avatar Mar 31 '21 15:03 mctrinkle

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 avatar Apr 02 '21 10:04 Randy-H0

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

Randy-H0 avatar Apr 02 '21 10:04 Randy-H0