Closed xhy3054 closed 5 years ago
tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28]
以上是报错,似乎是mnist数据集是灰度图?然后代码中处理时将均值设置的是对rgb的图像进行的
是的,书中错误了,需要把代码中的[0.5,0.5,0.5]替换成[0.5]就可以了。
RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28]
以上是报错,似乎是mnist数据集是灰度图?然后代码中处理时将均值设置的是对rgb的图像进行的