I already tried to do the same suggested by you but then I got below error-
data, _ = [_.cuda() for _ in batch]
AttributeError: 'list' object has no attribute 'cuda'

Above error disapperas when I don’t return 3 values from dataloader
test_loader is used as below-
testset = Dataset('test', args)
test_sampler = CategoriesSampler(testset.label, 1, # args.num_eval_episodes, 
args.eval_way, args.eval_shot + args.eval_query)
test_loader = DataLoader(dataset=testset, batch_sampler=test_sampler, num_workers=args.num_workers)

Do I have to adapt test_loader so that batch takes image name?