udacity / deep-learning-v2-pytorch

Projects and exercises for the latest Deep Learning ND program https://www.udacity.com/course/deep-learning-nanodegree--nd101
MIT License
5.26k stars 5.32k forks source link

transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)) will cause below error: RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28] #390

Closed xplanthris-zz closed 2 years ago

xplanthris-zz commented 2 years ago

transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)) will cause below error: RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28]

rrrrrr8 made a fix but it does not work my fix is transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5), (0.5))])