Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Randy-H0 opened this issue Mar 19, 2021 · 8 comments

Comments

@Randy-H0
Copy link

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
Copy link

mctrinkle commented Mar 19, 2021

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
Copy link
Author

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
Copy link

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?

@Randy-H0
Copy link
Author

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
Copy link
Author

Randy-H0 commented Mar 30, 2021

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
Copy link

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?

@Randy-H0
Copy link
Author

Randy-H0 commented Apr 2, 2021

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
Copy link
Author

Randy-H0 commented Apr 2, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants