Skip to content

Commit beca0be

Browse files
committed
fix: ensure average training time is calculated only when timed steps are available
1 parent 96334fb commit beca0be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

deepmd/pt/train/training.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ def log_loss_valid(_task_key="Default"):
10321032
with open("checkpoint", "w") as f:
10331033
f.write(str(self.latest_model))
10341034

1035-
if self.timing_in_training:
1035+
if self.timing_in_training and self.timed_steps:
10361036
msg = f"average training time: {self.total_train_time / self.timed_steps:.4f} s/batch"
10371037
excluded_steps = self.num_steps - self.start_step - self.timed_steps
10381038
if excluded_steps > 0:

0 commit comments

Comments
 (0)