stylegan-xl
stylegan-xl copied to clipboard
Discriminator pre-train models missing parameters
I am using both the generator and discriminator. Generator works well but the discriminator doesn't. Here is part of my code:
////////////load D and G with dnnlib.util.open_url(network_pkl) as f: D = legacy.load_network_pkl(f)['D'] D = D.eval().requires_grad_(False).to(device)
with dnnlib.util.open_url(network_pkl) as f: G = legacy.load_network_pkl(f)['G_ema'] G = G.eval().requires_grad_(False).to(device)
img = G.synthesis(w, update_emas=False) D(img, torch.empty([1, G.c_dim], device=device)) ////////////////
Error happened in the last line of code. I tried different pre-trained models, some time the error is missing AttributeError: 'Mlp' object has no attribute 'drop1', sometimes is missing "mean" and "std" for normalization layer.
Here is one error message:
/home/kaixuan/anaconda3/envs/GAN/lib/python3.9/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2228.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Traceback (most recent call last):
File "/home/kaixuan/Projects/MyStyleGAN_XL/D_run_tmp.py", line 136, in
Which version of timm are you using in your environment?
Thanks for your reply!
I was using timm=0.5.4 and I have re-installed the environment to make sure it's the same as the .yml file
However, I am still unable to use the discriminator, with the same piece of code, now I get following error: TypeError: 'NoneType' object is not subscriptable
Thanks for your reply!
I was using timm=0.5.4 and I have re-installed the environment to make sure it's the same as the .yml file
However, I am still unable to use the discriminator, with the same piece of code, now I get following error: TypeError: 'NoneType' object is not subscriptable
hello, I meet the same question: 'NoneType' object is not subscriptable, if you slove it, can you tell me how to slove? thanks