jeonsworld / MLP-Mixer-Pytorch

Pytorch reimplementation of the Mixer (MLP-Mixer: An all-MLP Architecture for Vision)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IndexError: Dimension out of range(expected to be in range of [-1, 0], but got 1)

hyuan1991 opened this issue · comments

Hey, I got this error when I was trying to fine tune on CIFAR 10 dataset.
I got the same error when I was trying to fine tune on my own dataset.

Anyone got the same error?

Thanks

commented

Hey, I got this error when I was trying to fine tune on CIFAR 10 dataset. I got the same error when I was trying to fine tune on my own dataset.

Anyone got the same error?

Thanks

Change two places:
(1) line 193:
import torch.nn.functional as F
output = model(x)
loss = F.cross_entropy(output, y)
(2) line 106:
logits = model(x)

Hope it can be helpful.

Change line 106 to logits = model(x) works.