Grayscale(num_output_channels=3) is used after ToPILImage(), which was throwing this error.
The new issue is for the svhn_transform. Apparently you are using Resize before ToPILImage. Could you change the order and run it again?