Unverified Commit 053c2153 authored by Quentin Lhoest's avatar Quentin Lhoest Committed by GitHub
Browse files

Mention why one needs to specify max_steps in Trainer (#22333)

* Mention why one needs to specify max_steps in Trainer

* dummy change to trigger CI
parent 5a9eb314
...@@ -544,7 +544,10 @@ class Trainer: ...@@ -544,7 +544,10 @@ class Trainer:
logger.info("max_steps is given, it will override any value given in num_train_epochs") logger.info("max_steps is given, it will override any value given in num_train_epochs")
if train_dataset is not None and not has_length(train_dataset) and args.max_steps <= 0: if train_dataset is not None and not has_length(train_dataset) and args.max_steps <= 0:
raise ValueError("train_dataset does not implement __len__, max_steps has to be specified") raise ValueError(
"The train_dataset does not implement __len__, max_steps has to be specified. "
"The number of steps needs to be known in advance for the learning rate scheduler."
)
if ( if (
train_dataset is not None train_dataset is not None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment