integrating record3d and fix checkpoint delete issue (#722)

* integrating record3d

* fix save checkpoint logic

* added record3d data
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-10-07 00:34:51 -07:00
1 parent fe5f7ea97d
commit 2531242d1d
3 files changed
+28 -12

No files matched your search

+3 -3
View File
@@ -285,6 +285,9 @@ class Trainer:
pipeline = self.pipeline.module.state_dict() # type: ignore
else:
pipeline = self.pipeline.state_dict()
if len(self.prev_ckpt_paths) == self.config.trainer.num_ckpt_to_save:
self.prev_ckpt_paths[0].unlink(missing_ok=True)
self.prev_ckpt_paths.pop(0)
torch.save(
{
"step": step,
@@ -295,9 +298,6 @@ class Trainer:
ckpt_path,
)
self.prev_ckpt_paths.append(ckpt_path)
if len(self.prev_ckpt_paths) > self.config.trainer.num_ckpt_to_save:
self.prev_ckpt_paths[0].unlink(missing_ok=True)
self.prev_ckpt_paths.pop(0)
@profiler.time_function
def train_iteration(self, step: int) -> Tuple[torch.Tensor, Dict[str, torch.Tensor], Dict[str, torch.Tensor]]: