简体   繁体   中英

How to interactively (e.g. using the terminal) intervene a for loop

I'm training my DQN and it often happens that I want to change a setting in the middle of the training. I know there is the option to terminate the running code via the terminal with CTRL + C but I'd like to intervene only after the currently running epoch has finished. Is there a way to implement that. (I'm using VS-Code)

You could insert a input() after every epoch and use this.. But that means that you have to sit in front of the computer the whole execution time to make the program execute without long pauses

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM