Yeah, I missed that. I probably accidentally changed that.
But unfortunately now it says that it gets .format(type(pic)) rather than a Tensor or ndarray. Sounds like something is wrong with the transform, but it looks ok. The last two lines in the trace are quite odd, it looks like they contradict each other (probably a mistake, I guess):

raise TypeError(‘pic should be Tensor or ndarray. Got {}.’.format(type(pic)))


TypeError: pic should be Tensor or ndarray. Got <class ‘torch.Tensor’>.

The full trace:
File “/home/nimrod/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py”, line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File “/home/nimrod/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py”, line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File “/home/nimrod/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py”, line 57, in 
samples = collate_fn([dataset[i] for i in batch_indices])
File “”, line 30, in getitem
x = self.mnist_transform(x)
File “/home/nimrod/anaconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py”, line 49, in call
img = t(img)
File “/home/nimrod/anaconda3/lib/python3.6/site-packages/torchvision/transforms/transforms.py”, line 110, in call
return F.to_pil_image(pic, self.mode)
File “/home/nimrod/anaconda3/lib/python3.6/site-packages/torchvision/transforms/functional.py”, line 103, 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 ‘torch.Tensor’>.