Skip to content

Duplicated Error message for IterDataPipe #516

@ejguan

Description

@ejguan

When the Error comes from singleton iterator. This part of message becomes duplicated.
You can run the following example:

source_dp = IterableWrapper(range(10))
it1 = iter(source_dp)
next(it1)
it2 = iter(source_dp)
next(it2)
next(it1)

The Error message is:

RuntimeError: This iterator has been invalidated because another iterator has been created from the same IterDataPipe: IterableWrapperIterDataPipe(deepcopy=True, iterable=range(0, 10))
This may be caused multiple references to the same IterDataPipe. We recommend using `.fork()` if that is necessary.
For feedback regarding this single iterator per IterDataPipe constraint, feel free to comment on this issue: https://github.com/pytorch/data/issues/45.
This exception is thrown by __iter__ of IterableWrapperIterDataPipe(deepcopy=True, iterable=range(0, 10))

cc: @NivekT

Originally posted by @ejguan in pytorch/pytorch#75618 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions