yunjey / stargan

StarGAN - Official PyTorch Implementation (CVPR 2018)
MIT License
5.21k stars 967 forks source link

Shape of InputSize #107

Closed wjun0830 closed 4 years ago

wjun0830 commented 4 years ago

I have cloned your repository and downloaded dataset by using download.sh file. However, when i run it on GPU, the error comes out.

Traceback (most recent call last):
  File "main.py", line 110, in <module>
    main(config)
  File "main.py", line 44, in main
    solver.train()
  File "/home/wjun0830/StarGAN/solver.py", line 246, in train
    d_loss_cls = self.classification_loss(out_cls, label_org, self.dataset)
  File "/home/wjun0830/StarGAN/solver.py", line 178, in classification_loss
    return F.binary_cross_entropy_with_logits(logit, target, size_average=False) / logit.size(0)
  File "/home/ubuntu/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/torch/nn/functional.py", line 2112, in binary_cross_entropy_with_logits
    raise ValueError("Target size ({}) must be the same as input size ({})".format(target.size(), input.size()))
ValueError: Target size (torch.Size([16, 8])) must be the same as input size (torch.Size([16, 5]))

Can I have solution for this error?