Skip to content

Commit 6e59195

Browse files
committed
fix warning
1 parent 24f0124 commit 6e59195

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pytorch_lightning/trainer/callback_hook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,14 @@ def on_load_checkpoint(self, checkpoint: Dict[str, Any]) -> None:
274274
if callback_states is None:
275275
return
276276

277-
current_callbacks_type = {type(cb) for cb in self.callbacks}
277+
current_callbacks_type = {cb.state_id for cb in self.callbacks}
278278
saved_callbacks_type = set(callback_states.keys())
279279
difference = saved_callbacks_type.difference(current_callbacks_type)
280280
if difference:
281281
rank_zero_warn(
282-
"Be aware that when using ``resume_from_checkpoint``, "
283-
"callbacks used to create the checkpoint need to be provided. "
284-
f"Please, add the following callbacks: {list(difference)}. ",
282+
"Be aware that when using ``resume_from_checkpoint``,"
283+
" callbacks used to create the checkpoint need to be provided."
284+
f" Please, add the following callbacks: {list(difference)}.",
285285
UserWarning,
286286
)
287287

0 commit comments

Comments
 (0)