nn.BCEWithLogitsLoss expects the model output and target to have the same shape.
Based on the new error message it seems that your model output has a shape of [35], while you are using a single target value only, which won’t work.
The expected shapes for a mulit-label classification would be [batch_size, nb_classes] for the model output and the target for nn.BCEWithLogitsLoss.