question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to handle CTRL-C during optimize?

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
silecommented, Dec 27, 2019
0reactions
g-vottecommented, Jan 8, 2020

Closing this issue. Please reopen it if you have any problem.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found