Hi, I have created a dataloader object from a subsetted dataset as:
target_index = np.random.choice(len(target_dataset), k_samp, replace= True)
target_dataset = torch.utils.data.Subset(target_dataset, target_index)
target_loader = torch.utils.data.DataLoader(target_dataset, batch_size=batch_size,
                                         shuffle=True, num_workers=workers)

When I enumerate over this dataloader as follows, the type for data is actually a list and not tensor
for i, data in enumerate(target_loader, 0):

I created my target_dataset as
target_dataset = dset.ImageFolder(root=target_dataroot,
                           transform=transforms.Compose([
                               transforms.Resize(image_size),
                               transforms.CenterCrop(image_size),
                               transforms.ToTensor(),
                               transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
                           ]))

I double checked and the contents of my target_dataroot are in fact images.
Not sure why I am getting a list when iterating over the dataloader instead of tensors?
Tried it with a few other subsetted datasets and iterating over those give me tensors.
Thanks