Dear Pytorch enthusiasts,
I have a question for you.
I have two datasets, and would like to use a different data iterator for each of them to train one model.
To do so, I have used DataLoader for each of them to get data iterators, and shuffle argument was set to True.
Then, I have used them as following under one loop, for each epoch:
for idx, datum in enumerate(zip(data_iterator1, data_iterator2)):
Here, the length of data_iterator1 is ~28 times longer than the length of data_iterator2.
Here I have the following questions in my mind:
- When the loop ends? Does it end when the loop sees all the batches belonging to data_iterator2, or it ends until seeing all the batches belonging to data_iterator1?
- If the loop ends after seeing all the batches belonging to data_iterator2, at the next epoch, are the data belonging to both data iterators shuffled again?
I would be thankful if someone here would clarify these 2 questions for me.
Thank for your time.
Best regards,