Open foreseez opened 3 years ago
The same for me :(
You may try this : from torchtext.legacy import data instead of from torchtext import data.
Thank you
On Wed, Apr 21, 2021 at 4:00 PM A-Kerim @.***> wrote:
You may try this : from torchtext.legacy import data instead of from torchtext import data.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SamLynnEvans/Transformer/issues/29#issuecomment-823901711, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAFS2ZTH3XW5DEKOYGAPT3TJ2H23ANCNFSM4ZGDCAKA .
-- Sent from my iPhone
You can install a old torchtext version: pip install torchtext==0.6.0
You may try this : from torchtext.legacy import data instead of from torchtext import data.
AttributeError: module 'torchtext' has no attribute 'legacy'
No one is maintaining torchtext anymore or what!!!
torchtext.legacy
Same problem for me. So I guess we need another Iterator.
You can install a old torchtext version: pip install torchtext==0.6.0
That's helpful, thank you!
Traceback (most recent call last): File "train.py", line 5, in <module> from Process import * File "/Users/pycharm_pro/PyTorch_Learning/Transformer/Process.py", line 5, in <module> from Batch import MyIterator, batch_size_fn File "/Users/pycharm_pro/PyTorch_Learning/Transformer/Batch.py", line 35, in <module> class MyIterator(data.Iterator): AttributeError: module 'torchtext.data' has no attribute 'Iterator'
https://pytorch.org/text/stable/data_functional.html
i guess whether the torchtext.data's api has changed ,but i don't find right api