mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[Tune] use epoch for ptl checkpoint dir name (#14392)
* use epoch for dir name * use formatted string
This commit is contained in:
parent
dbaa28f81e
commit
ca11b189b8
1 changed files with 2 additions and 1 deletions
|
@ -217,7 +217,8 @@ class _TuneCheckpointCallback(TuneCallback):
|
|||
def _handle(self, trainer: Trainer, pl_module: LightningModule):
|
||||
if trainer.running_sanity_check:
|
||||
return
|
||||
with tune.checkpoint_dir(step=trainer.global_step) as checkpoint_dir:
|
||||
step = f"epoch={trainer.current_epoch}-step={trainer.global_step}"
|
||||
with tune.checkpoint_dir(step=step) as checkpoint_dir:
|
||||
trainer.save_checkpoint(
|
||||
os.path.join(checkpoint_dir, self._filename))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue