Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'torchtext.legacy' #21

Open
Ziaurrehman1234 opened this issue Aug 30, 2023 · 0 comments
Open

ModuleNotFoundError: No module named 'torchtext.legacy' #21

Ziaurrehman1234 opened this issue Aug 30, 2023 · 0 comments

Comments

@Ziaurrehman1234
Copy link

I run the demo code. installed all required libraries but got error

ModuleNotFoundError Traceback (most recent call last)
in <cell line: 5>()

  4 from pathlib import Path

----> 5 from pytorch_lightning import Trainer
6 from pytorch_lightning.callbacks.model_checkpoint import ModelCheckpoint
7 # from pytorch_lightning.profiler import AdvancedProfiler

/usr/local/lib/python3.8/site-packages/pytorch_lightning/utilities/apply_func.py in
27 if _TORCHTEXT_AVAILABLE:
28 if _compare_version("torchtext", operator.ge, "0.9.0"):
---> 29 from torchtext.legacy.data import Batch
30 else:
31 from torchtext.data import Batch

ModuleNotFoundError: No module named 'torchtext.legacy'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant