deep-learning-for-image-processing icon indicating copy to clipboard operation
deep-learning-for-image-processing copied to clipboard

dimension does not match tensor

Open XuJ1E opened this issue 1 year ago • 0 comments

Traceback (most recent call last): File "train.py", line 124, in main(opt) File "train.py", line 87, in main train_loss, train_acc = train_one_epoch(model=model, File "F:\ImageClassification\EmotionClassification\utils.py", line 142, in train_one_epoch accu_num += torch.eq(pred_classes, labels.to(device)).sum() RuntimeError: The size of tensor a (256) must match the size of tensor b (2) at non-singleton dimension 2


Thanks for your wnoderful works, and here I have some problems about the dimension of batch_size, like up, is the batch_size not a tensor vector?

XuJ1E avatar Sep 21 '22 03:09 XuJ1E