Skip to content

Commit

Permalink
Fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
1pha committed Nov 23, 2023
1 parent 466b8b0 commit 1af26d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sage/trainer/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def on_validation_epoch_end(self, trainer, pl_module):
valid_loss = float(metrics["valid_loss"])
checkpoint_path = f"epoch{current_epoch}-valid_loss{valid_loss:.3f}.ckpt"
trainer.save_checkpoint(save_dir / checkpoint_path, weights_only=True)
self.self.epoch = next(self.save_epochs)
self.epoch = next(self.save_epochs)
2 changes: 1 addition & 1 deletion sage/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def forward(self, batch, mode: str = "train"):

def log_result(self, output: dict, unit: str = "step", prog_bar: bool = False):
output = {f"{unit}/{k}": float(v) for k, v in output.items()}
self.log_dict(dictionary=output,
self.log_dict(dictionary=output,
on_step=unit == "step",
on_epoch=unit == "epoch",
prog_bar=prog_bar)
Expand Down

0 comments on commit 1af26d6

Please sign in to comment.