Thanks for the code.
The error is thrown, because Normalize internally iterates the tensor channels, mean and std.
Since you just have one value, you should pass it as:
transforms.Normalize((0.5,), (0.5,))

Also, have a look at these mean and std estimates 13. They might work a bit better than 0.5, since they were calculated on the MNIST training data.