Good to hear it’s working now.
Is the input shape defined as [batch_size, height, width] or [channels, height, width]?
In either case, you should pass an input as [batch_size, channels, height, width] to conv layers.
If you are dealing with single channel images, just unsqueeze dim1:
input = input.unsqueeze(1)

For nn.CrossEntropyLoss (and nn.NLLLoss), the target should contain class indices in the shape [batch_size, height, width].
I assume your target already contains the background class as some class index (e.g. class0)?
If so, just transform all other classes to the background class:
background_class_index = 0
desired_class_index = 1
target[target!=desired_class_index] = background_class_index