optuna / optuna-examples

Examples for https://github.com/optuna/optuna
MIT License
634 stars 172 forks source link

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

Closed EduardoCarvalho35 closed 1 year ago

EduardoCarvalho35 commented 1 year ago

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.

EduardoCarvalho35 commented 1 year ago

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

nzw0301 commented 1 year ago

Could you share your optuna and pytorch-lightning versions?

EduardoCarvalho35 commented 1 year ago

Could you share your optuna and pytorch-lightning versions?

optuna version : 3.1.0 pytorch_lightning version : 2.0.0

nzw0301 commented 1 year ago

Thanks Optuna doesn't support pytorch_lightning 2.0, as mentioned in https://github.com/optuna/optuna/issues/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.

Alnusjaponica commented 1 year ago

Thank you for sharing the information. Actually, PyTorchLightningPruningCallback work with pytorch_lightning==2.0 (See https://github.com/optuna/optuna-examples/pull/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.