Hello Everyone, I have two datasets and want to use them simultaneously while training. The first dataset is a regression dataset containing 5000 while the second dataset is a classification dataset containing 25000 images. The target of the regression dataset is a list containing four numbers while for classification dataset it is a single value depicting the class. I want to train my model simultaneously on both the datasets. I tried creating two dataloaders and iterating through them as follows:
for index,data in enumerate(zip(cycle(dataloader1),dataloader2)):
I also tried reducing the batchsize of the smaller dataset in such a way that both the dataloaders execute the same number of times. But both the approaches were very slow and took more than an hour to process single epoch.
After that I am trying to use Concat dataset to concat both the datasets but when I am iterating through the dataloader created after concatenating the two datasets, it is throwing an error saying
only one element tensors can be converted to Python scalars .
Please guide me if you have any solutions.