我正试图使用Python3、TensorFlow2和CIFAR-10数据集,基于paper编写ResNet CNN体系结构。您可以访问Jupyter笔记本here
在使用“model.fit()”训练模型的过程中,经过一个历元的训练,我得到以下错误:
ValueError: Input 0 is incompatible with layer model: expected shape=(None, 32, 32, 3), found shape=(32, 32, 3)
使用batch_size=128对训练图像进行批处理,因此训练循环给出TF Conv2D期望的以下4-d张量-(128、32、32、3)
这个错误的来源是什么
好的,我在你的代码中发现了一个小问题。问题发生在测试数据集中。你忘了正确地变换它。那么现在你有这样的
您需要在测试中执行与在火车组上相同的转换。但当然,你要考虑的事情是:没有洗牌,没有扩充
相关问题 更多 >
编程相关推荐