-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
docsDocumentation relatedDocumentation relatedneeds triageWaiting to be triaged by maintainersWaiting to be triaged by maintainers
Description
📚 Documentation
Description:
The documentation indicates that setting num_sanity_val_steps
to -1
a sanity check is run on all validation batches. However, in Trainer._run_sanity_check, the sanity check only runs if self.num_sanity_val_steps > 0
. As a result, when num_sanity_val_steps
is set to -1
, no sanity check is run.
Steps to Reproduce:
- Instantiate Trainer with
num_sanity_val_steps = -1
. - Add validation dataloader.
- Call
trainer.fit()
. Notice that no sanity check is run.
Expected Behavior:
When num_sanity_val_steps
is -1
, the sanity check should iterate over all validation batches.
Actual Behavior:
The condition (self.num_sanity_val_steps > 0
) prevents any sanity checking when num_sanity_val_steps
is -1
.
Proposed Fix:
Update _run_sanity_check
to treat -1
as a special value that means “run all validation batches”, or update the documentation.
Metadata
Metadata
Assignees
Labels
docsDocumentation relatedDocumentation relatedneeds triageWaiting to be triaged by maintainersWaiting to be triaged by maintainers