Dataloader for multiple datasets using different batch sizes

Hi all,

I have two datasets of images.

I combined them using torch.utils.data.ConcatDataset and passed the combined dataset to torch.utils.data.DataLoader.

However, now I can only select one batch size. Is there a way to set individual batch sizes to both datasets?

Thanks!

No, that’s not possible using ConcatDataset since this new dataset is treated as one.
If you need different batch sizes, you could create two DataLoaders and set the desired batch size accordingly.