How many classes do you have?
Currently your output channel is only 1, which seems wrong. You should have at least 2 channels for a binary classification.

Input: (N,C)
where C = number of classes, or
(N,C,d1,d2,…,dK) with K≥2 in the case of K-dimensional loss.


Target: (N) where each value is 0≤targets[i]≤C−1
, or
(N,d1,d2,…,dK) with K≥2 in the case of K-dimensional loss.