IterableWrapper is not defined when using WikiText2
I am trying to follow along this tutorial https://pytorch.org/tutorials/beginner/transformer_tutorial.html
I am getting the following error when calling this function.
----&gt; 6 train_iter = WikiText2(split='train')
/usr/local/lib/python3.7/dist-packages/torchtext/datasets/wikitext2.py in WikiText2(root, split)
75         )
76
---&gt; 77     url_dp = IterableWrapper([URL])
78     # cache data on-disk
79     cache_compressed_dp = url_dp.on_disk_cache(
NameError: name 'IterableWrapper' is not defined
Here is the code:
from torchtext.datasets import WikiText2
from torchtext.data.utils import get_tokenizer
from torchtext.vocab import build_vocab_from_iterator
from torchdata.datapipes.iter import IterableWrapper

train_iter = WikiText2(split='train')

Let me know if you have any ideas.. Thanks
Antoine

I tried running the snippet of code you provided. I don't see
NameError: name 'IterableWrapper' is not defined
but I have a different error which says,
No module named 'torchdata'
I don't have torchdata installed.
So in your case, I would make sure if the torchdata is installed correctly.
You can look at this official Git and see if it works out
https://github.com/pytorch/data
Best regards
