Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pytorch_lightning/trainer/callback_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,14 @@ def on_load_checkpoint(self, checkpoint: Dict[str, Any]) -> None:
if callback_states is None:
return

current_callbacks_type = {type(cb) for cb in self.callbacks}
current_callbacks_type = {cb.state_id for cb in self.callbacks}
saved_callbacks_type = set(callback_states.keys())
difference = saved_callbacks_type.difference(current_callbacks_type)
if difference:
rank_zero_warn(
"Be aware that when using ``resume_from_checkpoint``, "
"callbacks used to create the checkpoint need to be provided. "
f"Please, add the following callbacks: {list(difference)}. ",
"Be aware that when using ``resume_from_checkpoint``,"
" callbacks used to create the checkpoint need to be provided."
f" Please, add the following callbacks: {list(difference)}.",
UserWarning,
)

Expand Down