- When I use Pycharm to run the (https://github.com/Joyce94/cnn-text-classification-pytorch) Pytorch program, multiple processes are opened on the Linux server, Occupy the server's large number of CPUs, run this program on WINDOWS10, the CPU and memory will be eaten up, because in train.py there is a lot of data training processing, will open multiple processes, occupy a large number of CPUs and processes.
- Linux Server opens multiple processes
- Linux server consumes a lot of CPU
- (http://pytorch.org/docs/master/multiprocessing.html) muliprocessing multi-process management in Pytorch, with pool process pools, process () And so on the process of management, it may be I use the wrong way, anyway, it has no effect.
- However, the simplest is also the best solution: torch.set_num_threads (int thread), can be a good solution to Windows problems, reference (http://pytorch.org/docs/master/torch.html #parallelism) However, there are still some problems on the Linux server, export OMP_NUM_THREADS = 1 can solve the Linux problem.
Solve multithreaded problems running Pytorch programs