aitorzip / PyTorch-CycleGAN

A clean and readable Pytorch implementation of CycleGAN
https://arxiv.org/abs/1703.10593
GNU General Public License v3.0
1.25k stars 289 forks source link

Error in pred_fake shape #24

Open nisargshah1999 opened 4 years ago

nisargshah1999 commented 4 years ago

/home/shah2/.local/lib/python3.6/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size. return F.mse_loss(input, target, reduction=self.reduction) torch.Size([1, 1]) torch.Size([1]) Epoch 001/200 [0001/2088] -- Traceback (most recent call last): File "PyTorch-CycleGAN/train", line 178, in images={'real_A': real_A, 'real_B': real_B, 'fake_A': fake_A, 'fake_B': fake_B}) File "/workspace/data/uiou_dark_zurich/PyTorch-CycleGAN/utils.py", line 39, in log self.losses[loss_name] = losses[loss_name].data[0] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number