optuna/optuna-examples

AttributeError: 'Trainer' object has no attribute 'training_type_plugin'

EduardoCarvalho35 opened this issue · 5 comments

Note to the questioner

If you are more comfortable with Stack Overflow, you may consider posting your question with the "optuna" tag there instead.
Alternatively, for issues that would benefit from more of an interactive session with the developers,
you may refer to the optuna/optuna chat on Gitter.

I am getting the following error and I can not figure out why:
AttributeError: 'Trainer' object has no attribute 'training_type_plugin'

Could you share your optuna and pytorch-lightning versions?

Could you share your optuna and pytorch-lightning versions?

optuna version : 3.1.0
pytorch_lightning version : 2.0.0

Thanks
Optuna doesn't support pytorch_lightning 2.0, as mentioned in optuna/optuna#4524. Could you use an older one? In addition, Optuna recently supports pytorch-lightning>1.5, which feature has not been released, so please use the master branch rather than 3.1.0.

Thank you for sharing the information.
Actually, PyTorchLightningPruningCallback work with pytorch_lightning==2.0 (See #179) on master branch, but the test fails since the mock class depends on deprecated features. Therefore, you can use pytorch_lightning==2.0 too if you used the master branch. Sorry for not updating the issue and make confusion.