stylegan2-pytorch
stylegan2-pytorch copied to clipboard
AssertionError : assert state["version"] in [2, 3, 4]
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
I think you may need to check your checkpoints is valid stylegan2 checkpoint.
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'
Okay - turns out that it works with stylegan2-ada checkpoints, my problem was that my --repo argument was pointing to the old stylegan2 repo.
@Quasimondo Oh, thank you for the test! I will check and update the readme.
ModuleNotFoundError: No module named 'dnnlib'
@FlashlightET Did you set --repo arguments to the path that contains dnnlib directory?
I met the same question,and I can't understand how to --repo arguments to the path that contains dnnlib directory.
@zhouyuezhou1 You need to clone official tensorflow repository and set --repo to the path of it.