rosinality / stylegan2-pytorch

Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch
MIT License
2.73k stars 620 forks source link

assert state["version"] in [2, 3] #200

Open Lvhhhh opened 3 years ago

Lvhhhh commented 3 years ago

when i run convert_weight.py --repo /media/31_sdf/stylegan2/ /media/31_sdf/stylegan2/pretrained_models/stylegan2-ffhq-config-f.pkl check the path is right and pkl is download from https://github.com/NVlabs/stylegan2 https://drive.google.com/drive/folders/1yanUI9m4b4PWzR0eurKNq6JR1Bbfbh6L

the error is : Traceback (most recent call last): File "/media/31_sdf/stylegan2/convert_weight.py", line 227, in generator, discriminator, g_ema = pickle.load(f) File "/usr/local/lib/python3.6/dist-packages/dnnlib/tflib/network.py", line 279, in setstate assert state["version"] in [2, 3]

rosinality commented 3 years ago

I think maybe version of the code that created pickle is different from repository you set.

nanlliu commented 2 years ago

same issue here. i trained a model based off the original stylegan2 repo.

lijiae commented 2 years ago

I made the same mistake delete it...it works momently : )

MarkZXZX commented 2 years ago

Maybe I found this solution!

the usage of "--repo stylegan2" is using the dnnlib in stylegan2, maybe u have installed the dnnlib by pip, so u should uninstall and try again