8

I want to set optuna's study.optimize verbosity to 0. I thought optuna.logging.set_verbosity(0) might do it, but I still get the Trial 0 finished with value .... updates for every trial

What is the correct way to do this? Unfortunately, extensive searching through the docs still only results in the above method.

Many thanks in advance

Olli
  • 906
  • 10
  • 25

2 Answers2

9

Try this:

optuna.logging.set_verbosity(optuna.logging.WARNING)

It basically changes the level of verbosity.

For more level choices, check optuna's official guides here.

Damon Roux
  • 314
  • 2
  • 3
2

optuna warnings tend to be raised using standard pythonic warnings.warn() (which explains why optuna.logging.set_verbosity() does not always work to suppress them), so you can silence them all at once with:

# treat all python warnings as lower-level "ignore" events
warnings.filterwarnings("ignore")

Be aware however, that this will silence also the useful and infrequent ones like deprecation warnings.

mirekphd
  • 4,799
  • 3
  • 38
  • 59