-
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
[blocked by #789] Fix/dataset check [wip] #883
Conversation
Hello @ethanwharris! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-02-17 16:35:12 UTC |
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 check #789, we shall coordinate the work a bit :]
@@ -55,13 +55,24 @@ def init_train_dataloader(self, model): | |||
self.get_train_dataloader = model.train_dataloader | |||
|
|||
# determine number of training batches | |||
if EXIST_ITER_DATASET and isinstance(self.get_train_dataloader().dataset, IterableDataset): | |||
self.is_iterable_train_dataloader = ( | |||
EXIST_ITER_DATASET and hasattr(self.get_train_dataloader(), 'dataset') and |
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.
some changes seem similar to #789...
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.
Yeah, hadn't seen that. Feel free to merge #789 through and I can rebase after :)
self.train_percent_check) | ||
except TypeError as e: | ||
# Assume infinite data loading if the dataloader doesn't implement __len__ | ||
if 'has no len' in str(e): |
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.
we shall have test for this...
Now handled in #955 |
Before submitting
What does this PR do?
Fixes #840 - also touches part of #698
Changed Exception order so that MisconfigurationException will be called and given the correct error when using IterableDataset
Removed dependency on
Dataloader.dataset
following Handle abstract loader that doesn't have a dataset member #840Changed TQDM call to prevent error when
num_training_batches == float('inf')
num_training_batches =float('inf')
is now the default when train dataloader doesn't have__len__
(in addition to when using anIterableDataset
)Added test for training using an iterable
Note that these only apply to the train dataloader, test / val using
IterableDataset
will still cause an error, but thought we should merge this first as stops a few annoying behavioursPR 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 🙃