Error Message is like below
51                         outputs = model(inputs)
—> 52                         loss = criterion(outputs, labels)
53
54                     _, preds = torch.max(outputs, 1)
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
720             result = self._slow_forward(*input, **kwargs)
721         else:
–> 722             result = self.forward(*input, **kwargs)
723         for hook in itertools.chain(
724                 _global_forward_hooks.values(),
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/loss.py in forward(self, input, target)
629                                                   self.weight,
630                                                   pos_weight=self.pos_weight,
–> 631                                                   reduction=self.reduction)
632
633
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in binary_cross_entropy_with_logits(input, target, weight, size_average, reduce, reduction, pos_weight)
2535         reduction_enum = _Reduction.get_enum(reduction)
2536
-> 2537     if not (target.size() == input.size()):
2538         raise ValueError(“Target size ({}) must be the same as input size ({})”.format(target.size(), input.size()))
2539
AttributeError: ‘list’ object has no attribute 'size’