Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40156

ImportError: cannot import name 'DILL_AVAILABLE'

I want to work with IMDB datasets. Trying to load using following command:

from torchtext.datasets import IMDB
train_iter = IMDB(root='~/datasets', split='train')

I am getting following error:

ImportError: cannot import name 'DILL_AVAILABLE' from 'torch.utils.data.datapipes.utils.common' (/home/user/env_p3.10.12_ml/lib/python3.10/site-packages/torch/utils/data/datapipes/utils/common.py)

How to solve it?

Upvotes: 2

Views: 1439

Answers (1)

Takahiro
Takahiro

Reputation: 1

I have met the same issue and I found this site. Following the GitHub issue page I modified the torch/utils/data/datapipes/utils/common.py by adding a new line: DILL_AVAILABLE = dill_available(). Then the issue was solved.

Upvotes: 0

Related Questions