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

[blocked by #789] Fix/dataset check [wip] #883

Closed

Conversation

ethanwharris
Copy link
Member

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
  • Did you read the contributor guideline?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

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 #840

  • Changed 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 an IterableDataset)

  • 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 behaviours

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 🙃

@pep8speaks
Copy link

pep8speaks commented Feb 17, 2020

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

@ethanwharris ethanwharris requested a review from a team February 17, 2020 16:30
Copy link
Member

@Borda Borda left a 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
Copy link
Member

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...

Copy link
Member Author

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):
Copy link
Member

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...

@ethanwharris ethanwharris changed the title Fix/dataset check [WIP] Fix/dataset check Feb 17, 2020
@Borda Borda changed the title [WIP] Fix/dataset check [WIP] Fix/dataset check [dependence on #789] Feb 19, 2020
@Borda Borda changed the title [WIP] Fix/dataset check [dependence on #789] [blocked by #789] Fix/dataset check [wip] Feb 21, 2020
@williamFalcon williamFalcon added this to the 0.6.1 milestone Feb 25, 2020
@ethanwharris
Copy link
Member Author

Now handled in #955

@ethanwharris ethanwharris deleted the fix/dataset_check branch February 27, 2020 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle abstract loader that doesn't have a dataset member
4 participants