Closing/Re-Using Data Loader Workers

Hi, I’m trying many configurations of my model using SMAC. Therefore, I’m training many models in the same script.
To speed up each of the models training, I’m using persistent_workers=True. However, it causes to the workers (and the file descriptors) to remain.
How can I close them after training a single model or re-use them in the other data loaders?


Maybe this post could help. I haven’t verified it, so let us know if it works for you.