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

AssertionError : assert state["version"] in [2, 3, 4] #164

Open
IvonaTau opened this issue Dec 16, 2020 · 8 comments
Open

AssertionError : assert state["version"] in [2, 3, 4] #164

IvonaTau opened this issue Dec 16, 2020 · 8 comments

Comments

@IvonaTau
Copy link

Hi,
I tried running convert_weight.py in a couple of different environments but I get the following error:

File "/stylegan2/dnnlib/tflib/network.py", line 278, in __setstate__
    assert state["version"] in [2, 3, 4]
AssertionError

Tensorflow : 1.15
Torch: 1.7
Torchvision: 0.8

@rosinality
Copy link
Owner

I think you may need to check your checkpoints is valid stylegan2 checkpoint.

@Quasimondo
Copy link

Quasimondo commented Dec 19, 2020

I am seeing the same error with stylegan2-ada TF checkpoints.
Looks like those checkpoints are version "5" - unfortunately just adding "5" to the assert does not help, since further down it causes another error, since the version 5 fused_bias seems to have at least one more argument "clamp".

TypeError: fused_bias_act() got an unexpected keyword argument 'clamp'

@Quasimondo
Copy link

Okay - turns out that it works with stylegan2-ada checkpoints, my problem was that my --repo argument was pointing to the old stylegan2 repo.

@rosinality
Copy link
Owner

@Quasimondo Oh, thank you for the test! I will check and update the readme.

@FlashlightET
Copy link

ModuleNotFoundError: No module named 'dnnlib'

@rosinality
Copy link
Owner

@FlashlightET Did you set --repo arguments to the path that contains dnnlib directory?

@zhouyuezhou1
Copy link

I met the same question,and I can't understand how to --repo arguments to the path that contains dnnlib directory.

@rosinality
Copy link
Owner

@zhouyuezhou1 You need to clone official tensorflow repository and set --repo to the path of it.

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

5 participants