Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store steps_per_epoch in Trainer #3601

Merged
merged 1 commit into from
Sep 14, 2023
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: 2 additions & 0 deletions ludwig/trainers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def __init__(

self.epochs = config.epochs
self.train_steps = config.train_steps
self.steps_per_epoch = 0 # Computed during training, after batcher has been initialized.
self.total_steps = 0 # Computed during training, after batcher has been initialized.

self.regularization_lambda = config.regularization_lambda
Expand Down Expand Up @@ -755,6 +756,7 @@ def train(
augmentation_pipeline=self.model.get_augmentation_pipelines(),
) as batcher:
# ================ Training Loop ================
self.steps_per_epoch = batcher.steps_per_epoch
self.total_steps = get_total_steps(self.epochs, batcher.steps_per_epoch, self.train_steps)

# Get the terminal steps per checkpoint.
Expand Down
Loading