I was plotting the images loaded by my data loader using an iterator and I observed that the images get repeated num_workers times in the iterator.
I am also using batch_size 1, is there a relationship between the batch size and max number num_workers can have? Should it be less than or equal to the batch_size
initialising the dataloader
train_dataloader = DataLoader(train_datagen1, shuffle=True, num_workers=2, batch_size=1)
iterating through the images
dataiter = iter(train_dataloader)
images, labels = dataiter.next()