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

Error on zero length dataloaders #1280

Merged

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Mar 29, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Fixes #1131.
Return a ValueError if user specified dataloaders has zero length (no batches). Current error returned are non-informative.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@ethanwharris
Copy link
Member

This looks nice :) could you add a test to make sure that the error is raised?

@codecov
Copy link

codecov bot commented Mar 29, 2020

Codecov Report

Merging #1280 into master will increase coverage by <1%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #1280    +/-   ##
=======================================
+ Coverage      92%     92%   +<1%     
=======================================
  Files          62      62            
  Lines        3188    3190     +2     
=======================================
+ Hits         2920    2922     +2     
  Misses        268     268

Copy link
Member

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - LGTM :)

@mergify
Copy link
Contributor

mergify bot commented Mar 29, 2020

This pull request is now in conflict... :(

Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

pytorch_lightning/trainer/data_loading.py Outdated Show resolved Hide resolved
@Borda Borda added bug Something isn't working ready PRs ready to be merged labels Mar 30, 2020
@Borda Borda added this to the 0.7.2 milestone Mar 30, 2020
@Borda Borda requested a review from a team March 30, 2020 16:52
@williamFalcon williamFalcon merged commit 2ccc745 into Lightning-AI:master Mar 30, 2020
alexeykarnachev pushed a commit to alexeykarnachev/pytorch-lightning that referenced this pull request Apr 3, 2020
* error_on_zero_length

* update CHANGELOG.md

* added test

* Update pytorch_lightning/trainer/data_loading.py

Co-authored-by: Nicki Skafte <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
@SkafteNicki SkafteNicki deleted the error_on_zero_len_dataloader branch April 21, 2020 13:51
@Borda Borda modified the milestones: v0.7., v0.7.x Apr 18, 2021
@carmocca carmocca mentioned this pull request Feb 25, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better message when DataLoader is wrong
4 participants