This line in the evaluation function of training pipeline gives error for multiclass loss calculation for losses such as cross entropy.
It should change to
loss = criterion(outputs, labels) if num_classes > 1 else criterion(outputs, labels.unsqueeze(1).float())
The same way as it is computed in the training function.
This line in the evaluation function of training pipeline gives error for multiclass loss calculation for losses such as cross entropy. It should change to
loss = criterion(outputs, labels) if num_classes > 1 else criterion(outputs, labels.unsqueeze(1).float())
The same way as it is computed in the training function.