-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pytorch_lightning
mixed with lightning.pytorch
: Getting a "ValueError('Expected a parent')" when using a list of Callbacks
#96
Comments
Thank you @CedricLeon for this very verbose report! I really appreciate that you added all the references, too! ❤️ |
Seems like we need to be a bit more careful. Our As for the imports in the module, I think I'll still play it safe and do a A mess, indeed |
The new version on pypi (1.2.2) should have this fixed now! Can you let me know if it works for you? |
Oh, I was too fast about that, I skipped the package management 😅 sorry. |
Context
I see that you are using the old version of Pytorch Lightning in the lightning hooks:
There was some change in lightning a while ago and they renamed the package from
pytorch_lightning
tolightning
. This actuallymade quite a mess (you can check here for more details).
Error
From the update, mixing
pytorch_lightning
withlightning.pytorch
is causing an error.For example when creating a list of Callbacks, some depending on
pytorch_lightning.Callbacks
and other onlightning.pytorch.Callbacks
.This is what happened to me when I tried to add
TriggerWandbSyncLightningCallback
to my Trainer.Here is the generated error:
(I am using hydra and several libraries who made the change to
pytorch_lightning
)You can find more detals in the issue #17485.
Also, you can see a similar update/fix in the PR #5028 of Optuna.
Fix
I think simply replacing:
by
would do the trick
I will try opening a PR to fix that.
Thanks for your work and have a nice day!
The text was updated successfully, but these errors were encountered: