biggerfish:

Expected target size (8, 2), got torch.Size([8])


This error message is related to the loss function with input and target arguments. Apparently, the input is of size [8, 2] but the target is of size [8]. So you should use the on-hot vector of the ground-truth labels as target.