You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using IterableDataset with len in Trainer. This change makes it return a sampler and results in an error later. ValueError: DataLoader with IterableDataset: expected unspecified sampler option, but got sampler=<torch.utils.data.sampler.RandomSampler object at 0x7fa32c57b340>
Maybe change to this?
if (isinstance(self.train_dataset, torch.utils.data.IterableDataset) ornotisinstance(self.train_dataset, collections.abc.Sized)):
In my case, I wrap a Dataset using a class that inherits IterableDataset, and defines a __len__().
The purpose is to implement smart batching[1]. I use IterableDataset so I can control how to iterate the data.
transformers/src/transformers/trainer.py
Lines 381 to 382 in 08f534d
This used to be (before #7858)
I am using IterableDataset with len in Trainer. This change makes it return a sampler and results in an error later.
ValueError: DataLoader with IterableDataset: expected unspecified sampler option, but got sampler=<torch.utils.data.sampler.RandomSampler object at 0x7fa32c57b340>
Maybe change to this?
@j-rossi-nl @sgugger
The text was updated successfully, but these errors were encountered: