Skip to content

Trainer.predict is not working on TPUs #7664

@KijitoraButi

Description

@KijitoraButi

🐛 Bug

Trainer.predict does not seem to run correctly when using TPU.
I get an error "TPUs do not currently support IterableDataset objects, the dataset must implement __len__. HINT: You can mock the length on your dataset to bypass this MisconfigurationException." even though I am using a dataset that implements __len__.

To Reproduce

If you create an instance of Trainer with tpu_cores=1 or 8, and run predict, an error occurs.

Notebook: https://colab.research.google.com/drive/1yHI-eKlfdq_zXUSPWmNvivEPJKl8RZbA?usp=sharing

Expected behavior

Return the output of the model.

Environment

  • PyTorch Version (e.g., 1.0): 1.8
  • Any other relevant information: Google Colab with TPU accelerator

Metadata

Metadata

Assignees

Labels

accelerator: tpuTensor Processing UnitbugSomething isn't workinghelp wantedOpen to be worked onpriority: 0High priority task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions