In my train data, I have two class here.
In following way:
      dataset = dset.ImageFolder(root=opt.dataroot_train,
                                transform=transforms.Compose([
                                    transforms.Resize(opt.imageSize),
                                    transforms.CenterCrop(opt.imageSize),
                                    transforms.ToTensor(),
                                    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
                                ]))

        hazy=[]
        gt=[]
        for gt_i in range(int(len(dataset)/2)):
            gt.append(dataset[gt_i][0]) # changed here
        assert gt
        #####--------------------------------------------------------
        # alternative with bellow
        for hazy_i in range(int(len(dataset)/2), int(len(dataset))):
            hazy.append(dataset[hazy_i][0])
        assert hazy
        dataset=list(zip(gt,hazy))
        print('dataset.size',len(dataset))
        dataloader = torch.utils.data.DataLoader(dataset,batch_size=opt.batSize,
                                                    shuffle=True, num_workers=int(opt.workers))

I can random load these two bounded dataset by data loader. But how can I select  gt or hazy from this dataloader?