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

Enable val/test loop disabling + datamodule tests #2692

Merged
merged 38 commits into from
Jul 25, 2020

Conversation

nateraw
Copy link
Contributor

@nateraw nateraw commented Jul 24, 2020

What does this PR do?

This updates MisconfigurationExceptions to be warnings instead within trainer when you have dataloaders/defined steps for val/test that aren't configured correctly. Just because you have a validation dataloader doesn't mean you want to use it, and just because your model defines a val_step doesn't mean you should need to provide a validation dataset.

CC: @awaelchli we discussed something about this the other day 😄

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 your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

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 🙃

@mergify mergify bot requested a review from a team July 24, 2020 21:01
@rohitgr7
Copy link
Contributor

Nice! It solves the problem of commenting out the validation_step or val_dataloader / test code whenever it's not needed. 😅

@nateraw
Copy link
Contributor Author

nateraw commented Jul 24, 2020

Nice! It solves the problem of commenting out the validation_step or val_dataloader / test code whenever it's not needed. 😅

Exactly!! I have it a bit wrong so far here though. Test step should still raise misconfiguration but only if self.testing.

@pep8speaks
Copy link

pep8speaks commented Jul 24, 2020

Hello @nateraw! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-07-25 16:43:11 UTC

@williamFalcon williamFalcon changed the title Loader misconfiguration warnings Loader misconfiguration warnings + datamodule tests Jul 25, 2020
@Borda Borda added allowed_pre_1.0 feature Is an improvement or enhancement ci Continuous Integration labels Jul 25, 2020
@williamFalcon
Copy link
Contributor

williamFalcon commented Jul 25, 2020

Features:

  • enables skipping val loop when not needed
  • enables skipping test loop when not needed
  • refactors some of the trainer
  • adds datamodule tests
  • adds config validator tests

future

  • sets up more refactors for the trainer

@williamFalcon williamFalcon changed the title Loader misconfiguration warnings + datamodule tests Enable val/test loop disabling + datamodule tests Jul 25, 2020
@williamFalcon williamFalcon merged commit 9076551 into Lightning-AI:master Jul 25, 2020
Comment on lines 336 to +340
if not self.reload_dataloaders_every_epoch:
self.reset_train_dataloader(model)
self.reset_val_dataloader(model)

if model.val_dataloader is not None:
self.reset_val_dataloader(model)
Copy link
Contributor

@awaelchli awaelchli Jul 25, 2020

Choose a reason for hiding this comment

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

it looks like val dataloaders get reloaded every epoch no matter the setting of self.reload_dataloaders_every_epoch. Isn't this a bug?

Copy link
Contributor

Choose a reason for hiding this comment

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

that’s how it was before no? i think that was intended this way

Copy link
Contributor

Choose a reason for hiding this comment

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

is there an issue about it?

Copy link
Contributor

Choose a reason for hiding this comment

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

if it's intended, ok. Just the name of the flag is a bit misleading then :)

is there an issue about it?

There does not seem to be one.

@mergify mergify bot requested a review from a team July 25, 2020 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants