clovaai / stargan-v2

StarGAN v2 - Official PyTorch Implementation (CVPR 2020)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

forward() missing 2 required positional arguments: 'x' and 's'

panghongwei17 opened this issue · comments

when I run the python main.py --mode sample --num_domains 3 --resume_iter 100000 --w_hpf 0
--checkpoint_dir expr/checkpoints/afhq
--result_dir expr/results/afhq
--src_dir assets/representative/afhq/src
--ref_dir assets/representative/afhq/ref
then error:
forward() missing 2 required positional arguments: 'x' and 's'

If you are using multiple GPUs, you may specify just one of them using CUDA_VISIBLE_DEVICES=0 or 1 or whichever.

If you are using multiple GPUs, you may specify just one of them using CUDA_VISIBLE_DEVICES=0 or 1 or whichever.
Thank you very much for your method, the problem has been solved, wish you happiness

os.environ['CUDA_VISIBLE_DEVICES'] = '0'

I add torch.nn.DataParallel like this:
net = torch.nn.DataParallel(model)
output = net(input)

It worked.