【发布时间】:2020-07-08 12:56:10
【问题描述】:
PyTorch
我正在尝试在我自己的数据集上构建 CNN,该数据集有 39 个不同的类。
我遇到一个运行时错误
错误
RuntimeError Traceback (most recent call last)
<ipython-input-42-67f1329ebfd8> in <module>()
16 images, labels = images.to(device), labels.to(device)
17
---> 18 train = Variable(images.view(100, 1, 28, 28))
19 labels = Variable(labels)
20
RuntimeError: shape '[100, 1, 28, 28]' is invalid for input of size 62720
RuntimeError: shape '[100, 1, 28, 28]' 对于大小为 62720 的输入无效。
【问题讨论】:
标签: python pytorch conv-neural-network