Thank you for the reply and help, however can I do this instead?
to have “filenames = data.imgs”
def get_all_images(data_location):
data = datasets.ImageFolder(data_location, transform=test_transforms)
classes = data.classes
filenames = data.imgs
loader = torch.utils.data.DataLoader(data,batch_size = len(data))
dataiter = iter(loader)
images, labels = dataiter.next()
return filenames,classes,images, labels