Using IterableDataset with Trainer - `IterableDataset' has no len()

Hi Eric - you need to format your dataset for PyTorch first, like so: torch_iterable_dataset = dataset.with_format("torch").

More info on how and why can be found here: Error iteration over IterableDataset using Torch DataLoader 路 Issue #2583 路 huggingface/datasets 路 GitHub

Hope that helps!

Cheers
Heiko

4 Likes