Skip to content

Commit 1d118c4

Browse files
diego-urgellfacebook-github-bot
authored andcommitted
Enable DCP checkpoints with on_eval_epoch_end hook (#851)
Summary: Pull Request resolved: #851 Reviewed By: zedsdead01, JKSenthil Differential Revision: D58967392 fbshipit-source-id: 0ecdd0bec0804167127daa2530bf77b63bf7ca6e
1 parent 8afe26d commit 1d118c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

torchtnt/framework/callbacks/dcp_saver.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ def _checkpoint_impl(
136136
planner: Optional[SavePlanner] = None,
137137
storage_writer: Optional[StorageWriter] = None,
138138
) -> bool:
139-
if hook not in ["on_train_step_end", "on_train_epoch_end", "on_train_end"]:
139+
if hook not in [
140+
"on_train_step_end",
141+
"on_train_epoch_end",
142+
"on_train_end",
143+
"on_eval_epoch_end",
144+
]:
140145
raise RuntimeError(f"Unexpected hook encountered '{hook}'")
141146

142147
intra_epoch = hook == "on_train_step_end"

0 commit comments

Comments
 (0)