UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([16])) is deprecated. Please ensure they have the same size.
"Please ensure they have the same size.".format(target.size(), input.size()))
Traceback (most recent call last):
File "main.py", line 188, in
dis_errD_real = dis_criterion(dis_output, dis_label)
File "/home/.../envs/python36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "/home/.../envs/python36/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 372, in forward
size_average=self.size_average)
File "/home/.../envs/python36/lib/python3.6/site-packages/torch/nn/functional.py", line 1171, in binary_cross_entropy
"!= input nelement ({})".format(target.nelement(), input.nelement()))
ValueError: Target and input must have the same number of elements. target nelement (1) != input nelement (16)
UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([16])) is deprecated. Please ensure they have the same size. "Please ensure they have the same size.".format(target.size(), input.size())) Traceback (most recent call last): File "main.py", line 188, in
dis_errD_real = dis_criterion(dis_output, dis_label)
File "/home/.../envs/python36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "/home/.../envs/python36/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 372, in forward
size_average=self.size_average)
File "/home/.../envs/python36/lib/python3.6/site-packages/torch/nn/functional.py", line 1171, in binary_cross_entropy
"!= input nelement ({})".format(target.nelement(), input.nelement()))
ValueError: Target and input must have the same number of elements. target nelement (1) != input nelement (16)