Once you create an iterator, it will start loading the batches and accumulating them into a queue, but it’s bounded, so it will never load the whole dataset. Once the queue fills up the workers will wait until you take out some data. Since you’re using num_workers=2 the data loading happens asynchronously with your script execution, and you have 2 background processes that fill up the queue.