-
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
fixed extra dataloader bug #1196
fixed extra dataloader bug #1196
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1196 +/- ##
=======================================
+ Coverage 92% 92% +<1%
=======================================
Files 62 62
Lines 3188 3191 +3
=======================================
+ Hits 2920 2923 +3
Misses 268 268 |
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.
pls add CHNAGELOG note
This looks good, it's not clear how the |
Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com>
…xtra_dataloader_bug-fix
I've added a note in CHANGELOG.md |
self.get_model() => model as it was already defined
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.
LGTM
Sorry, I'm not sure what the next steps are at the moment - @williamFalcon , do you want to follow @ethanwharris 's suggestion of changing |
@TevenLeScao yes, let's rename to |
…xtra_dataloader_bug-fix # Conflicts: # CHANGELOG.md # pytorch_lightning/trainer/training_loop.py
This pull request is now in conflict... :( |
@@ -338,14 +338,14 @@ def run_evaluation(self, test_mode: bool = False): | |||
|
|||
# select dataloaders | |||
if test_mode: | |||
if self.reload_dataloaders_every_epoch or self.test_dataloaders is None: | |||
if self.reload_train_dataloader_every_epoch or self.test_dataloaders is None: |
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.
this is wrong no? don’t we want to reset the test and val dataloaders with every call to evaluate?
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.
Edit: I'm not sure what evaluation_loop
is used for; why would we want to reload the test and/or val dataloader when it is called ? It doesn't strike me as an "every epoch" kind of thing.
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.
If we want to keep that, maybe the compromise is to keep the name reload_dataloaders_every_epoch
, and consider that this reloads the train dataloader every training epoch in training_loop
, and the val/test dataloaders at every evaluation in evaluation_loop
. This would fix the initial bug and keep all functionality the same and I feel like that should be the main objective here. I can just revert the last changes in this case, and the previously-approved PR should be good to go. Sorry if I'm reinventing the wheel here !
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.
I thought the point was just that the reload_train_dataloader_every_epoch was doing stuff with test and val when it wasn't needed - not to revert the change?
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.
I'm actually not sure anymore ! At least here I understand that @williamFalcon wants to reset them and @ethanwharris you want to call it reload_train_dataloader_every_epoch
and not reset them.
But in any case I think it's better to have reload_dataloaders_every_epoch
stand for everything, as it keeps previous functionality and doesn't split it into an argument for everything (ie train val and test)
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.
evaluate runs the test and val loop.
Maybe i'm missing something, but if the user wants to reload the validation and test datasets every time evaluation is checked that should be allowed no?
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.
Haha, I'm confused. Originally tbe point was made that reload_dataloaders_every_epoch
didn't previously reload the test and val dataloaders, only train. So then I suggested the name change, but it turns out we do reload them? Anyway, let's make it so that reload_dataloaders_every_epoch
does what it says on the tin and applies to val and test aswell, in which case I think the above comment from @tullie still applies. Can then revisit it if someone finds a use case where that doesn't work for them :)
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.
@ethanwharris is this also solved?
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.
It should be fixed now, but the CI says some checks were cancelled and I'm not sure why :/
Edit: seems fine second time around
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.
check comments
Should be good to go now ! |
So is there anything left to do here before merging ? |
* fixed extra dataloader bug * Update pytorch_lightning/trainer/training_loop.py Co-Authored-By: Jirka Borovec <Borda@users.noreply.github.com> * updated CHANGELOG * Small non-repetition change self.get_model() => model as it was already defined * Update CHANGELOG.md * changed argument name to reload_train_dataloader_every_epoch * fixed doc underline too short * reverted to `reload_dataloaders_every_epoch` * fixed val and test reloading * fixed val and test reloading Co-authored-by: TevenLeScao <teven.lescao@gmail.com> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
What does this PR do?
Fixes #1181 (issue).