I encountered a similar problem with multiprocessing and for loops in CPU. It’s not a fundamental solution, but -W option works for me, e.g. python -W ignore main.py. This makes training stable in my environment.
I tried using warnings module to ignore the warning, but it’s not worked. I think this is because semaphore trackers’ processes are generated internally.
my environment.: linux, python=3.7, pytorch-cpu=0.4.1, start_method=spawn