Closed williamxiongwei closed 3 years ago
Hi @williamxiongwei!
Is it possible that the save_dir
already contains a latents.pt
file containing latent codes of the cars domain? i.e. of shape (16,512)? If it is the case, it is possible that the latent codes are loaded from there and not inferred from the input images directory, therefore resulting in missing style vectors for the 1024 resolution FFHQ model, so i will advise trying to save the results to an empty directory.
Best, Omer
Hi @williamxiongwei! Is it possible that the
save_dir
already contains alatents.pt
file containing latent codes of the cars domain? i.e. of shape (16,512)? If it is the case, it is possible that the latent codes are loaded from there and not inferred from the input images directory, therefore resulting in missing style vectors for the 1024 resolution FFHQ model, so i will advise trying to save the results to an empty directory.Best, Omer
Great job. This does correct the error! Thanks a lot.
Awsome!
Hi, Would you like to help solve the error while calling inference.py with pretrained faces model. By the way, everything goes well while calling inference.py with pretrained cars model. Error is listed as follows(cmd: python scripts/inference.py --images_dir=images/from/faces --save_dir=images/to e4e_ffhq_encode.pt): raceback (most recent call last): File "scripts/inference.py", line 137, in
main(args)
File "scripts/inference.py", line 24, in main
net, opts = setup_model(args.ckpt, device)
File "/root/miniconda3/envs/e4e_env/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context
return func(*args, *kwargs)
File "scripts/inference.py", line 109, in generateinversions
imgs, = g([latent_codes[i].unsqueeze(0)], input_is_latent=True, randomize_noise=False, return_latents=True)
File "/root/miniconda3/envs/e4e_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(input, **kwargs)
File "./models/stylegan2/model.py", line 530, in forward
out = conv2(out, latent[:, i + 1], noise=noise2)
IndexError: index 16 is out of bounds for dimension 1 with size 16
I appreciate your help. Thanks indeed!