Guidelines for assigning num_workers to DataLoader

I use multi subprocesses to load data(num_workers =8) and with the increase of epoch,I notice that the (RAM, but not GPU) memory increases.
I thought may be I can kill subprocesses after a few of epochs and then reset new subprocesses to continue train the network,but I don’t know how to kill the subprocesses in the main processes.

And I set num_workers = 0,the (RAM, but not GPU) memory remains stable with the increase of epoch.

Can you give me some suggestions or instructions about the problem?

Thank you so much.

4 Likes