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

DataModules: improve error messages #1441

Merged
merged 6 commits into from
Jul 7, 2023

Conversation

adamjstewart
Copy link
Collaborator

@adamjstewart adamjstewart commented Jun 21, 2023

Closes #1307

This implementation defines two new helper functions:

  • _valid_attribute: checks if at least one of the datasets or samplers has length > 0
  • _dataloader_factory: defines a *_dataloader depending on the split

The former handles all error messages and provides more specific and helpful error messages. Another bonus is that we avoid the majority of code duplication in these base classes, chopping off 30+ lines of code.

@yichiac I know you've run into this error message too many times, hopefully this will help with debugging.

@adamjstewart adamjstewart added this to the 0.5.0 milestone Jun 21, 2023
@github-actions github-actions bot added the datamodules PyTorch Lightning datamodules label Jun 21, 2023
@adamjstewart adamjstewart marked this pull request as draft June 21, 2023 22:08
@adamjstewart adamjstewart marked this pull request as ready for review June 22, 2023 18:58
@github-actions github-actions bot added the testing Continuous integration testing label Jun 22, 2023
@adamjstewart adamjstewart changed the title DataModules: better error messages DataModules: improve error messages Jun 22, 2023
@adamjstewart adamjstewart merged commit 9d6d683 into microsoft:main Jul 7, 2023
21 checks passed
@adamjstewart adamjstewart deleted the datamodules/error-msg branch July 7, 2023 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datamodules PyTorch Lightning datamodules testing Continuous integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve data module error messages
2 participants