nn.CrossEntropyLoss expects the target as a LongTensor and to have the shape [batch_size] containing the class indices in the range [0, nb_classes].
Since your target is one-hot encoded, you could use:
target = torch.argmax(target, dim=1)`

to create the expected shape and type.
PS: It’s better to post code snippets by wrapping them into three backticks ``` instead of screenshots.