What is the feature?
In mmegine.dataset.sampler.InfiniteSampler, would it better to change the function InifiniteSampler.iter to the following:
def __iter__(self) -> Iterator[int]:
"""Iterate the indices."""
# yield from self.indices
try:
for i in self.indices:
yield i
except StopIteration as e:
self.indices = self._indices_of_rank()
return self.__iter__()
the original code is
def __iter__(self) -> Iterator[int]:
"""Iterate the indices."""
yield from self.indices
which may raise error when iter the dataloader more than once.
Any other context?
No response
What is the feature?
In mmegine.dataset.sampler.InfiniteSampler, would it better to change the function InifiniteSampler.iter to the following:
the original code is
which may raise error when iter the dataloader more than once.
Any other context?
No response