-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
Length check fails for IterableDataset #1076
Comments
@snie2012 thanks for the report! Yes, you are right about that. We have a test with ignite/tests/ignite/engine/test_engine.py Line 511 in a2f302b
IterableDataset with unknown length !
|
@snie2012 the bug should be fixed in the next nightly release |
Should
Where |
@SantoshGuptaML no, torch's There are various way to route samples depending on process (distributed or simply mp):
In case of distributed training, the simplest way to distribute it (if possible) is to set up your iterable dataset depending on the rank: import ignite.distributed as idist
rank = idist.get_rank()
ws = idist.get_world_size()
dataset = get_iterable_dataset(..., rank=rank, world_size=ws, ...) where |
I am using IterableDataset with unknown length. It fails inside the following
if
clause:ignite/ignite/engine/engine.py
Line 642 in cc78b3b
Here is the logic why it fails:
__len__
attr, so it goes into theif
clauseepoch_length = len(data)
, and leads tolength = self._IterableDataset_len_called = len(self.dataset)
indataloader.py
in pytorchTypeError: object of type 'IterableDataset' has no len()
My concern is that we shouldn't expect IterableDataset to have
__len__
and the code should not fail because of it. Any thoughts on this?The text was updated successfully, but these errors were encountered: