Unable to figure issue in binary classifier

Hi,
I am trying to build a binary classifier to classify pneumonia in radiology images. here is my model architecture

here is code to train the model

NUM_EPOCHS = 5
BEST_MODEL_PATH = 'best_model.pth'
best_accuracy = 0.0

optimizer = optim.SGD(model.parameters(), lr=0.001)

for epoch in range(NUM_EPOCHS):
    train_error_count=0.0
    for images, labels in iter(train_loader):
        labels = labels.type(torch.FloatTensor)
        images = images.to(device)
        labels = labels.to(device)
        optimizer.zero_grad()
        outputs = model(images)
        train_error_count += float(torch.sum(torch.abs(labels - outputs.argmax(1))))
        outputs = torch.squeeze(outputs)
        loss = nn.BCELoss()(outputs, labels)
        loss.backward()
        optimizer.step()
        
    train_accuracy = 1.0 - float(train_error_count) / float(len(train_dataset))
    
    test_error_count = 0.0
    for images, labels in iter(test_loader):
        images = images.to(device)
        labels = labels.to(device)
        outputs = model(images)
        test_error_count += float(torch.sum(torch.abs(labels - outputs.argmax(1))))
    
    test_accuracy = 1.0 - float(test_error_count) / float(len(test_dataset))
    print('Epoch %d: train_acc =%f  test_acc =%f' % (epoch, train_accuracy, test_accuracy))
    if test_accuracy > best_accuracy:
        torch.save(model.state_dict(), BEST_MODEL_PATH)
        best_accuracy = test_accuracy
        print('Best Model Saved!!!')

I am unable to train it successfully because it is showing the following accuracy.
image

It would be great if anyone can identify a bug. I am a beginner in PyTorch so it would be helpful.
Thank you,

outputs.argmax(1) will return an all zero tensor, since your output has the shape [batch_size, 1].
To get the prediction after a sigmoid layer you could use a threshold such as:

preds = outputs > 0.5

Afterwards, you could calculate the accuracy or error by comparing the target tensor to this prediction tensor.