Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[Train model] Prevent division by zero in ETA calculation #3555

Merged
merged 1 commit into from
Mar 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parlai/scripts/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def _compute_eta(
eta = time_left

max_train_steps = self.opt.get('max_train_steps', -1)
if max_train_steps > 0:
if max_train_steps > 0 and steps_taken > 0:
steps_progress = steps_taken / max_train_steps
eta = (1 - steps_progress) * time_elapsed / steps_progress

Expand Down