Welcome to the Linux Foundation Forum!

(Self-solved) Chap8,Lab4 "Dataset": Encountered "ImportError" about "DILL_AVAILABLE"

Posts: 24
edited May 2024 in LFD273 Class Forum

I encountered an error on Lab4 "Dataset" part in Chap8.
This is a workaround I did.

[Problem I encountered]

When executed 4th cell,

  1. from torchtext.datasets import SST2
  2. datapipes = {}
  3. # write your code here
  4. datapipes['train'] = SST2(split='train')
  5. datapipes['val'] = SST2(split='dev')

then following error came up.

ImportError: cannot import name ‘DILL_AVAILABLE’ from ‘torch.utils.data.datapipes.utils.common’

[Workaround I did]

Following link seems to be about same problem.

https://discuss.dgl.ai/t/importerror-cannot-import-name-dill-available-from-torch-utils-data-datapipes-utils-common/4363

And this refers to a following PR to PyTorch upstream.

https://github.com/pytorch/pytorch/pull/122616

This PR provides two modifications torch/utils/data/datapipes/utils/common.py , so I modified the file following the modifications and re-executed. Then, worked fine (i.e. no error came up).

Thanks,

Comments

  • Posts: 24
    edited May 2024

    [My Environment]
    OS : Ubuntu20.04LTS
    Python : 3.8.10
    torch : 2.3.0
    torchdata : 0.7.1
    torchtext : 0.18.0
    torchvision : 0.18.0

  • Posts: 7

    Hi @m.taniguchi

    Thank you for already providing the solution/workaround for this PyTorch 2.3 issue!

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training