报错:using fork to start your child process The “freeze_support()“ line can be omitted if the program

(<class 'RuntimeError'>, RuntimeError('\n        
           An attempt has been made to start a new process before the\n        
           current process has finished its bootstrapping phase.\n\n        
           This probably means that you are not using fork to start your\n        
           child processes and you have forgotten to use the proper idiom\n        
           in the main module:\n\n           
            if __name__ == \'__main__\':\n                
            freeze_support()\n                ...\n\n        The "freeze_support()" line can be omitted if the program\n        is not going to be frozen to produce an executable.'), <traceback object at 0x000002518DC2B040>)
parser.add_argument('--num_workers', type=int, default=0, help='number of workers for the train loader')
parser.add_argument('--num_workers_test', type=int, default=0, help='number of workers for the test loader')

Guess you like

Origin blog.csdn.net/ResumeProject/article/details/121300854