I am using a DataLoader like this :
dataset_train = TumorSegmentationDataset(train_csv)
train_loader = DataLoader(dataset_train,batch_size= batch,shuffle=True, num_workers=4)

And I access my data like this:
for batch_idx, (subject) in enumerate(train_loader):
        # Load the subject and its ground truth

        image = subject['image']
        mask = subject['gt']

Oh, so you mean num_workers=4 might be causing this issue of print statements coming in the order that I do not expect?