Party 1:
pool = torch.multiprocessing.Pool(torch.multiprocessing.cpu_count(), maxtasksperchild=1)
Party 2:
Modify the tensor mode of multithreading to file_ System (the default mode is file)_ Descriptor, limited by the number of open files:
torch.multiprocessing.set_sharing_strategy('file_system')
Party 3:
Increase the number of open files:
Instead of using sudo ulimit – N command, execute:
sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"