-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix num batches in case of multiple dataloaders and percent_check #1920
Fix num batches in case of multiple dataloaders and percent_check #1920
Conversation
Still needs to figure out why tests are failing. Need some help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in _reset_eval_dataloader
you need to update the type hint for the retun to
Tuple[List[int], List[DataLoader]]:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more thing to make a test pass:
in tests/deprecated.py change max_batches=1
to max_batches=[1]
Hello @rohitgr7! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-18 07:40:19 UTC |
I will help fix the rest of the tests tomorrow |
I will write new test cases tomorrow. |
@awaelchli I was thinking to add just 1 test in which we will test both multiple val and test dataloaders with different sizes by just comparing num_batches for both. This is sufficient or should I add more tests and assertions?? |
Testing the num_batches for multiple with different sizes is good. However, a more important test imo is checking also that the dataloaders get consumed by that amount. |
@awaelchli Yeah, good idea. But can't figure out how to do that within tests. |
I think the test is good and covers the base case, thanks for adding it! I will try to generalize it a bit more if you don't mind and post here. |
hey @rohitgr7 I was able to parameterize the test and make it consistent for train, val, test. |
There is also a PR #1959 that adds support for multiple train dataloaders, so if that one gets merged first we need to make a few adjustments here :) |
This pull request is now in conflict... :( |
1 similar comment
This pull request is now in conflict... :( |
I made a small mistake with git there! Apologies. |
yes I saw, no big deal, now we just need to fix this small merge conflict :) |
Just a suggestion! Can we have |
Not sure how useful that is, but how about you open an issue for that? |
Codecov Report
@@ Coverage Diff @@
## num_batches_missing_test #1920 +/- ##
==========================================================
Coverage ? 88%
==========================================================
Files ? 69
Lines ? 5249
Branches ? 0
==========================================================
Hits ? 4606
Misses ? 643
Partials ? 0 |
@williamFalcon @Borda Thanks, it's very kind you were able to add us as authors there. I already submitted a new PR #2226 with the missing test, because was not able to push here. EDIT: sorry I don't understand all this co-author stuff, I hope I did not create a mixup. |
we can still merge this one, @rohitgr7 🐰 |
@Borda Getting some problems with the tests here. Not sure why it's not showing any conflict to me locally when I rebase on the master. @awaelchli has already created a new PR that is working perfectly. I think we can close this one and merge that one. |
This pull request is now in conflict... :( |
@rohitgr7 @awaelchli the simples solution from this situation is that I merger this PR to #2226 and then the other PR will be merged in |
Thanks @Borda for the fix. |
* Init fix num_batches * Fix num_batches in case of multiple dataloaders * Apply suggestions from code review * Changes based on suggestions * Flake8 * Add test to check num_batches * generalize dataloader percent check test * fix formatting * remove hparams * tests * CHANGELOG * Update CHANGELOG.md * max_batches can be int * conflict and rebase * add back the test fix fix message 0.0 works Revert "fix message" This reverts commit 839cacf8b8610f4e697e654ef6f3d2501bf23984. * update changelog * Update CHANGELOG.md * Fix num batches in case of multiple dataloaders and percent_check (#1920) * git conflict Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> * missing union * doc update suggestion by @rohitgr7 * extend test * changelog * docs add note about multiple loaders * update changelog * remove unused variable Co-authored-by: rohitgr7 <rohitgr1998@gmail.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Before submitting
What does this PR do?
Fixes #1899.
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 🙃