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

Integer limit_val_batches does not work with infinite DataLoader. #2649

Closed
discharged-spider opened this issue Jul 20, 2020 · 2 comments · Fixed by #2787
Closed

Integer limit_val_batches does not work with infinite DataLoader. #2649

discharged-spider opened this issue Jul 20, 2020 · 2 comments · Fixed by #2787
Assignees
Labels
bug Something isn't working help wanted Open to be worked on

Comments

@discharged-spider
Copy link

🐛 Bug

Documentation states that you can use limit_val_batches=100 (with integer value) to limit number of batches. However, when using IterableDataset I get the following error:
pytorch_lightning.utilities.exceptions.MisconfigurationException: When using an infinite DataLoader (e.g. with an IterableDataset or when DataLoader does not implement __len__) for limit_val_batches, Trainer(limit_val_batches) must be 0.0 or 1.0.

To Reproduce

Just use:
pl.Trainer(val_check_interval=10, limit_val_batches=100)

with infinite DataLoader.

Expected behavior

Do only N (100 in this case) validation steps.

Environment

  • CUDA:
    - GPU:
    - GeForce GTX 1080 Ti
    - available: True
    - version: 10.0.130
  • Packages:
    - numpy: 1.17.4
    - pyTorch_debug: False
    - pyTorch_version: 1.3.1
    - pytorch-lightning: 0.8.5
    - tensorboard: 2.2.2
    - tqdm: 4.46.1
  • System:
    - OS: Linux
    - architecture:
    - 64bit
    -
    - processor: x86_64
    - python: 3.7.4
    - version: Proposal for help #1 SMP Wed Mar 7 19:03:37 UTC 2018
@discharged-spider discharged-spider added bug Something isn't working help wanted Open to be worked on labels Jul 20, 2020
@github-actions
Copy link
Contributor

Hi! thanks for your contribution!, great first issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants