Thanks for replying.

However, what changes are you applying to your custom Dataset ?

The images that I am dealing with are too large to process at once and hence each time I can only see a glimpse/patch of the original image. The ‘changes’ are simply the new coordinates of the next glimpse.

Note that each worker will work on a copy of the Dataset , so manipulating it is not trivial and you might need to use shared arrays/dicts etc.

My current implementation assumes that there is only one copy which is why issues arise when I use multiple workers. It would be really helpful if you could elaborate on how I could implement shared lists. I will look into the custom sampler and get back to you  Thanks!