Hello.
I am facing an unexpected behaviour in my dataloading scheme. I have two dataloaders, a train_dl and a test_dl. The train_dl provides batches of data with the argument shuffle=True and the test_dl provide batches with the argument shuffle=False.
I evaluate my test metrics each N epochs, i.e each N epochs I loop over test_dl dataset. I have realized that if the value of N changes, then the shuffled batches provided by the train_dl after evaluating the test metrics differ. In other words, suppose my training points are labelled: a,b,c,d,e,f and my batch size is 2. Then if I seed everything correctly I observe the following pattern always:
Epoch 1:
Batch 1: [a,b]
Batch 2: [e,d]
Batch 3: [c,f]
Epoch 2:
Batch 1: [a,f]
Batch 2: [b,d]
Batch 3: [e,c]
However, if in between epoch 1 and epoch 2 I loop over my test_dl then the provided batches at epoch 2 differ or in other words it seems that even shuffle = False for the test_dl, the random state seems to change.
Is this true?
Thanks