Hi all.
I am trying to train my model using various image sizes and batch sizes.
I want to train my model using multiple dataloaders.
Here’s how I can simply think about it in code.
dataloader1(image_size=(1024, 512), batch_size=2,...)
dataloader2(image_size=(512, 256), batch_size=4,...)
dataloader3(image_size=(256, 128), batch_size=8,...)

for epoch in range(0, epochs):
    for idx, (input, target) in enumerate(dataloader1):
            loss1
    for idx, (input, target) in enumerate(dataloader2):
            loss2
    for idx, (input, target) in enumerate(dataloader3):
            loss3

    tot_loss = loss1 + loss2 + loss3
    tot_loss.backward()

The method that comes to mind right now is the same as above. Does the above method work properly? Or is there another efficient way?
In summary, I want to train one model using multiple data loaders, add up each loss and update it back to one model.
Please let me know if there is any possible example or method.
Thank you.