I have made a custom dataset class based on the ImageFolder class. When I load a batch of the dataset using :
inputs, labels = next(iter(dataloaders[‘train’]))
The batch is loaded correctly. However, when I try to load the data in my training loop similarly to the Transfer Learning tutorials, i.e :
for data in dataloaders[phase]:
I get the following error :
‘OSError: cannot identify image file <_io.BufferedReader name=’/path/to/file/sample.png’>
This is not my first custom ImageFolder class, yet it is the first time that I am encountering this type of error. Any ideas as to what might be going wrong ?
PS : I am using 0.3.1