Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Fix calculation of estimated time remaining #1631

Merged
merged 1 commit into from
Aug 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion allennlp/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ def train(self) -> Dict[str, Any]:
training_elapsed_time = time.time() - training_start_time
estimated_time_remaining = training_elapsed_time * \
((self._num_epochs - epoch_counter) / float(epoch - epoch_counter + 1) - 1)
formatted_time = time.strftime("%H:%M:%S", time.gmtime(estimated_time_remaining))
formatted_time = str(datetime.timedelta(seconds=int(estimated_time_remaining)))
logger.info("Estimated training time remaining: %s", formatted_time)

epochs_trained += 1
Expand Down