Skip to content

Subclasses of torch.utils.data.DataLoader are not supported #812

@jwindhager

Description

@jwindhager

🐛 Bug description

When using the Ignite engine with a subclass of torch.utils.data.DataLoader, the engine re-instantiates the dataloader with its torch.utils.data.DataLoader base class, if the DataLoader's batch_sampler is not a ReproducibleBatchSampler. See engine.py, line 874 in my version (call to _update_dataloader).

This is super-dangerous, as people might not even notice that their custom DataLoader isn't being used at all. Only found the issue because my custom DataLoader has some additional public members that aren't parameters of the torch.utils.data.DataLoader constructor, which is being called in _update_dataloader.

Environment

  • PyTorch Version: 1.4.0
  • Ignite Version: 0.3.0
  • OS: Linux
  • How you installed Ignite: conda
  • Python version: 3.7.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions