It seems that your system allows only for a small number of open files. Can you try adding torch.multiprocessing.set_sharing_strategy('file_system')
at the top of your script and try again?
Just append python
after the three backticks to add syntax highlighting.