Home > other >  For help, in python thread pool task how to interrupt
For help, in python thread pool task how to interrupt

Time:04-20

I am now doing a display system, is used to show a deep learning model, I now need to show model under different parameters in training process, because the training completion time is very long, so want to be able to manually stop the current training process, and show the next training process, I want to use a thread pool to complete the function, but before the training to finish after the task to submit all can't stop, your bosses have what way?

CodePudding user response:

To build a global variable, in the task cycle to test the variables,

 
Global task_status

Def task () :
While task_status:
# do something


CodePudding user response:

Useless, for the model training didn't finished, the program will not to the next cycle
  • Related