Skip to content
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

Unnecessary warning when resuming training #8833

Closed
eladsegal opened this issue Aug 10, 2021 · 1 comment · Fixed by #7161
Closed

Unnecessary warning when resuming training #8833

eladsegal opened this issue Aug 10, 2021 · 1 comment · Fixed by #7161
Assignees
Labels
bug Something isn't working callback help wanted Open to be worked on priority: 1 Medium priority task
Milestone

Comments

@eladsegal
Copy link
Contributor

🐛 Bug

When training is resumed with resume_from_checkpoint, a warning is given about missing callbacks even if the expected callbacks are included.

I got the following:

UserWarning: Be aware that when using ``resume_from_checkpoint``, 
callbacks used to create the checkpoint need to be provided. 
Please, add the following callbacks: ['BetterModelCheckpoint', 'FreezeUnfreeze']

when the relevant variables had these values:

current_callbacks_type: {<class 'src.callbacks.model_checkpoint.BetterModelCheckpoint'>, 
<class 'src.callbacks.freeze_unfreeze.FreezeUnfreeze'>, ...}
saved_callbacks_type: {'BetterModelCheckpoint', 'FreezeUnfreeze'}

From a quick look, it seems that the source of the bug is that in current_callbacks_type there are types, and in saved_callbacks_type there are strings from Callback.state_id (which is .__qualname__ of the type).

https://github.com/PyTorchLightning/pytorch-lightning/blob/3096ab88ebb1d9c9c07c3230829171925c9e678a/pytorch_lightning/trainer/callback_hook.py#L277-L286


Sorry I didn't follow the template for reporting bugs. If this isn't enough, I'll be able to update the issue in a few days.

@eladsegal eladsegal added bug Something isn't working help wanted Open to be worked on labels Aug 10, 2021
@awaelchli
Copy link
Contributor

awaelchli commented Aug 10, 2021

Thanks @eladsegal I noticed it too. Great you could find the issue in the code. If you wish feel free to send a PR for the fix. If not I will take a look.
The problem should only exist on master, the state_id changes are not released, so I'm setting the milestone to 1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working callback help wanted Open to be worked on priority: 1 Medium priority task
Projects
None yet
2 participants