I have a similar issue to this @ptrblck @idontknow
I have a custom image dataset modeled closely after this official  pytorch tutorial 4.
The dataset passes a PIL image to a transform function:
class Resize(object):
    """Resize the image in a sample to a given size.
    Args:
        output_size (int): Desired size in pixels. Yields output_size by output_size image
    """

    def __init__(self, output_size):
        assert isinstance(output_size, int)
        self.output_size = output_size

    def __call__(self, sample):
        image = sample

        resized_image = image.resize((self.output_size, self.output_size))

        return resized_image

At the point where PIL Image.resize() is called, I get this error:
File “test.py”, line 52, in 
for samples in train_dataloader:
File “/Users/nick/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py”, line 345, in next
data = self._next_data()
File “/Users/nick/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py”, line 385, in _next_data
data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
File “/Users/nick/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py”, line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/Users/nick/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py”, line 44, in 
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/Users/nick/opt/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataset.py”, line 207, in getitem
return self.datasets[dataset_idx][sample_idx]
File “/Users/nick/Projects/Personal_Projects/CNN/datasets/LDataset.py”, line 52, in getitem
sample = self.transform(sample)
File “/Users/nick/opt/anaconda3/lib/python3.7/site-packages/torchvision/transforms/transforms.py”, line 70, in call
img = t(img)
File “/Users/nick/Projects/Personal_Projects/CNN/datasets/LTransforms.py”, line 24, in call
resized_image = image.resize((self.output_size, self.output_size))
AttributeError: ‘tuple’ object has no attribute ‘resize’