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  左手边五十米  阅读(312)  评论(0编辑  收藏  举报