This is the error that I am getting as a result of the code:
‘’’
Traceback (most recent call last):
File “/Users/Josh/Desktop/convolutional_neural_networks/pytorch_convolutional_neural_network_mnist.py”, line 233, in 
transformed_image = transform(new_image)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torchvision/transforms/transforms.py”, line 61, in call
img = t(img)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torchvision/transforms/transforms.py”, line 127, in call
return F.to_pil_image(pic, self.mode)
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/torchvision/transforms/functional.py”, line 100, in to_pil_image
raise TypeError(‘pic should be Tensor or ndarray. Got {}.’.format(type(pic)))
TypeError: pic should be Tensor or ndarray. Got <class ‘PIL.JpegImagePlugin.JpegImageFile’>.
‘’’
Am I doing something wrong?