Solved by LeviViana in post #4 
              
              
                You can create a copy of this file and customize it the way you want. Here this module  will spawn parallel processes according to their rank. You could arrange your script so that the cmd could look like cmd = python -m detector.script --local_rank --arg1 --arg2 ....