and this is the error I always get no matter how i try to apply the suggestions i found online:
0%|          | 0/22452 [00:00<?, ?it/s]torch.Size([4, 1, 50, 50])
torch.Size([1, 2])
torch.Size([4, 2, 56, 56])

ValueError                                Traceback (most recent call last)
 in ()
13         outputs = model(batch_x)
14         outputs = outputs.squeeze(0)
—> 15         loss = loss_function(outputs, batch_y)
16         loss.backward()
17         optimizer.step()    # Does the update
3 frames
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in nll_loss(input, target, weight, size_average, ignore_index, reduce, reduction)
2214     if input.size(0) != target.size(0):
2215         raise ValueError(‘Expected input batch_size ({}) to match target batch_size ({}).’
-> 2216                          .format(input.size(0), target.size(0)))
2217     if dim == 2:
2218         ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
ValueError: Expected input batch_size (4) to match target batch_size (1).