ii am getting this error now please help.
model  = UNet()
criterion = torch.nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters() , lr=0.0001, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, amsgrad=False)
num_epochs=7
total_step = len(test_data)
loss_list = []
acc_list = []
lbls=[]
pred=[]
for epoch in range(num_epochs):
for i ,(images, labels) in enumerate(test_data):
outputs = model(images)
    #preds = torch.argmax(outputs,dim=1)
    preds = outputs.unsqueeze(dim=1)
    labels=labels.unsqueeze(dim=-1)
    #outputs= outputs.argmax(outputs,dim=1)###
    #loss = F.nll_loss(pred, labels)

    loss = criterion(preds.float() , labels)
    loss_list.append(loss.item())
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()
    
    total = labels.size(0)
    _, predicted = torch.max(preds, 1)
    correct = (predicted == labels).sum().item()
    acc_list.append(correct / total)
    lbls+=labels
    pred+=predicted
    if (i + 1) % 1 == 0:
        print('Epoch [{}/{}], Step [{}/{}], Loss: {:.4f}, Accuracy: {:.2f}%'
              .format(epoch + 1, num_epochs, i + 1, total_step, loss.item(),
                      (correct / total) * 100))

“”“ValueError: Expected target size (2, 2, 132, 132), got torch.Size([2, 1])”""