OK, sorry for the misunderstanding.
In this case:

for nn.CrossEntropyLoss you should use nb_classes channels in your output. The target does not contain the channel dimension (but all others) and stores class indices of type torch.long.

nn.BCEwithLogitsLoss should get tensors with the same dimension (and the same floating type) for your output and target.
usually the dice loss needs predictions, i.e. you would apply a threshold on the sigmoid of your output. However, this depends on your implementation of the dice loss. The shapes should be the same for your output and target.