smth:

import torch
import torchvision
a=torchvision.datasets.MNIST(root=’.’, download=True, transform=torchvision.transforms.ToTensor())
iter(torch.utils.data.DataLoader(a)).next()


Yes, the MNIST example worked for me too. For some reason, though, my custom images are somehow contributing to my dataiter or trainloader or something being uniterable…?
Perhaps someone can try running the code themselves to see if there is just an issue on my side somehow? It’s clear that the compiler thinks that one of my variables is actually a method.
EDIT : Here is my FULL error message:
Traceback (most recent call last):
  File "classifier.py", line 32, in <module>
(images, labels) = DataLoaderIter(trainloader).__next__()
File "//anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 174, in __next__
return self._process_next_batch(batch)
File "//anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 198, in _process_next_batch
 raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File "//anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 34, in _worker_loop
 samples = collate_fn([dataset[i] for i in batch_indices])
File "//anaconda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 34, in <listcomp>
samples = collate_fn([dataset[i] for i in batch_indices])
File "//anaconda/lib/python3.6/site-packages/torchvision/datasets/folder.py", line 67, in __
getitem__
img = self.transform(img)
File "//anaconda/lib/python3.6/site-packages/torchvision/transforms.py", line 29, in __call__
img = t(img)
File "//anaconda/lib/python3.6/site-packages/torchvision/transforms.py", line 130, in __call__
w, h = img.size
TypeError: 'builtin_function_or_method' object is not iterable