How to handle CTRL-C during optimize?
See original GitHub issueI’m trying print the best parameters and plot some visualizations after CTRL-C during optimization. This is the code I tried, but it doesn’t work:
try:
study.optimize(objective, n_trials=N_OPT_TRIALS, timeout=timeout)
except KeyboardInterrupt:
pass
logging.info("study.best_params %s", str(study.best_params))
optuna.visualization.plot_optimization_history(study)
optuna.visualization.plot_contour(study)
What am I doing wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
julia - Ctrl+C does not interrupt optimize!() regardless of solver
When I run a JuMP model using optimize!(), I cannot interrupt the execution using ctrl+C. When I press ctrl+C, the REPL completely ignores...
Read more >xsel - zsh - optimize copy, cut, paste using ctrl+c, ctrl+x, ctrl+v
It enables me to copy using ctrl + c , cut using ctrl + x , paste using ctrl + v . However,...
Read more >Ctrl-C - Hacker News
This makes no sense. Ctrl-C is just a way to tell your terminal to send a SIGINT signal to the current process. How...
Read more >Control C Interrupt Handler | Data Distribution Service (DDS ...
I am currently running my application from the command prompt, and have the need to handle a SIGINT event. I have put the...
Read more >Signal handling - Command Line Applications in Rust
The most common example is probably Ctrl + C , the signal that typically tells a process to terminate. To handle signals in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI I found a StackOverflow post that seems similir to this problem: https://stackoverflow.com/questions/42653389/ctrl-c-causes-forrtl-error-200-rather-than-python-keyboardinterrupt-exception.
Closing this issue. Please reopen it if you have any problem.