Hi, what could be right approach to concatenate 2 datasets having different classes/labels. For example dataset D1 has folders for “cat” and “dog” whereas dataset D2 has folders like “elephant” and “lion”. Right now I created empty folders named “elephant” and “lion” in dataset D1 to preserve the labels and vice versa before using ImageFolder and ConcatenateDataset as bellow:
ds = torch.utils.data.ConcatDataset(
[datasets.ImageFolder(’./data/D1/train’, transform),
datasets.ImageFolder(’./data/D2/train’, transform)]
)