As I understand, this is your main concern:



 bayes_and_blues:

but the batch generation runs in the main process


It may look like batch generation is been doing only in the main, but if you check the output of the Linux top command throughout the program execution, you will clearly see the additional number of processes has been fired up, and they were busy utilizing some PCU compute power.
With regard to the printing of error about executing in main, I am not sure, but I think every instance of dataloader has its own instance of dataset.