can't import torchtext.legacy.data

6.2k Views Asked by At

enter image description here

as i know, from torchtext 0.9.0, torchtext.data and torchtext.dataset are moved to torchtext.legacy

but my 0.12.0 torchtext can't import torchtext.legacy while it can import torchtext.data

I tried if it moved to torchtext.data again but I can't find any document

  • torch.version == 1.11.0
1

There are 1 best solutions below

0
On

I also faced the same problem wtih the same versions. The only thing I was able to do about it is to install previous version of torchtext:

pip install torchtext==0.6.0

Only then was I wable to import the packs.