MNIST数据集output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28]

transform = transforms.Compose([
transforms.ToTensor(),
transforms.Lambda(lambda x: x.repeat(3,1,1)), #添加这行
transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
])

posted @ 2022-10-28 19:17  sdibt布谷鸟  阅读(258)  评论(0编辑  收藏  举报