MixMatch-pytorch
MixMatch-pytorch copied to clipboard
How to apply it to my own dataset?
I tried to apply it to my own dataset, but it didn't work because unmarked data had to be enhanced twice. Thank you very much for who can help me
what is your problem? I suggest write your own dataset class to read your images. Here is the dataset class read images from a path
class YourDatasetName(Dataset):
def __init__(self, root_dir, transform=None):
self.root_dir = root_dir
self.transform = transform
self.image_lists = os.listdir(root_dir)
def __len__(self):
return len(self.image_lists)
def __getitem__(self, item):
image_path = os.path.join(self.root_dir, self.image_lists[item])
image = Image.open(image_path)
image = image.convert('RGB')
if self.transform:
img_tensor_1 = self.transform(image)
img_tensor_2 = self.transform(image)
return img_tensor_1, img_tensor_2
Thank you for your help. Under your inspiration, I solved this problem. Thank you very much
@sakumashirayuki Have you tried training in a multi gpu setting with DP/DDP?