RuntimeError: shape ‘[-1, 400]’ is invalid for input of size 10816

计算10816
x = x.view(-1, 16 * 5 * 5)
10816=163737
修改
x = x.view(x.size(0), 163737)
x = x.view(-1, 16 * 37* 37)

还要改一句
nn.Linear(16 * 37* 37, 120)

你可能感兴趣的:(RuntimeError: shape ‘[-1, 400]’ is invalid for input of size 10816)