Hello, I would like to get the image filenames from the DataLoader. What's the easiest way to do this? Is it safe to assume the order of the images is the same as input when accessing the data by iterating through the data loader object as long as shuffle = False like this. I.e., will all_labels and local_train_images match in ordering?
train_ds = ImageDataset(image_files=local_train_images, labels=train_labels, transform=train_transforms)
train_loader = DataLoader(train_ds, batch_size=8, shuffle=False, num_workers=2, pin_memory=pin_memory)
all_labels = []
for batch_data in train_loader:
step += 1
inputs, labels = batch_data[0].to(device), batch_data[1].to(device)
all_labels.append(labels)
Hello, I would like to get the image filenames from the DataLoader. What's the easiest way to do this? Is it safe to assume the order of the images is the same as input when accessing the data by iterating through the data loader object as long as shuffle = False like this. I.e., will all_labels and local_train_images match in ordering?