Solved by ptrblck in post #4 
              
              
                Remove the softmax and the torch.argmax. 
Also, if your target is one-hot encoded, I assume you are dealing with a multi-class classification, so replace nn.BCEWithLogitsLoss with nn.CrossEntropyLoss.