optuna/optuna-examples

Pytorch Lightning (PL) >=v1.8 support

MBus123 opened this issue · 1 comments

The PL example uses optuna.integration.PyTorchLightningPruningCallback as a callback for a PL Trainer (Version 1.8 or higher), resulting into the following error message:

RuntimeError: The on_init_start callback hook was deprecated in v1.6 and is no longer supported as of v1.8.

Expected behavior

The code runs without any errors.

Environment

  • Optuna version: 3.0.3
  • Python version: 3.10.6
  • OS: NixOS 22.0.5
  • Pytorch-Lightning: 1.8.1

Error messages, stack traces, or logs

RuntimeError: The `on_init_start` callback hook was deprecated in v1.6 and is no longer supported as of v1.8.

Steps to reproduce

  1. pip install optuna
  2. pip install pytorch-lightning
  3. Run the PL example
  4. Error