File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
pytorch_lightning/callbacks Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -265,16 +265,16 @@ def state_key(self) -> str:
265265 save_on_train_epoch_end = self ._save_on_train_epoch_end ,
266266 )
267267
268- def on_pretrain_routine_start (self , trainer : "pl.Trainer" , pl_module : "pl.LightningModule" ) -> None :
269- """
270- When pretrain routine starts we build the ckpt dir on the fly
271- """
272- self .__resolve_ckpt_dir (trainer )
268+ def on_init_end (self , trainer : "pl.Trainer" ) -> None :
273269 if self ._save_on_train_epoch_end is None :
274270 # if the user runs validation multiple times per training epoch, we try to save checkpoint after
275271 # validation instead of on train epoch end
276272 self ._save_on_train_epoch_end = trainer .val_check_interval == 1.0
277273
274+ def on_pretrain_routine_start (self , trainer : "pl.Trainer" , pl_module : "pl.LightningModule" ) -> None :
275+ """When pretrain routine starts we build the ckpt dir on the fly."""
276+ self .__resolve_ckpt_dir (trainer )
277+
278278 def on_train_start (self , trainer : "pl.Trainer" , pl_module : "pl.LightningModule" ) -> None :
279279 self ._last_time_checked = time .monotonic ()
280280
You can’t perform that action at this time.
0 commit comments