pytorch / text

Models, data loaders and abstractions for language processing, powered by PyTorch
https://pytorch.org/text
BSD 3-Clause "New" or "Revised" License
3.5k stars 814 forks source link

torchtext main branch doesn't support pytorch2.0 #2052

Open YangQun1 opened 1 year ago

YangQun1 commented 1 year ago

Hi,

I want to build torchtext from source by using 'python setup.py clean install'. the version of pytorch I used is 2.0.0. But it report the following error:

Installed /home/yangqun/miniconda3/envs/pt/lib/python3.8/site-packages/torchtext-0.15.0a0+9db75ab-py3.8-linux-x86_64.egg
Processing dependencies for torchtext==0.15.0a0+9db75ab
error: torch 2.0.0a0+git13b3d86 is installed but torch==1.13.1 is required by {'torchdata'}

When I try to import torchtext, the following error is reported;

>>> import torch
>>> import torchtext
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yangqun/text/torchtext/__init__.py", line 6, in <module>
    from torchtext import _extension  # noqa: F401
  File "/home/yangqun/text/torchtext/_extension.py", line 64, in <module>
    _init_extension()
  File "/home/yangqun/text/torchtext/_extension.py", line 56, in _init_extension
    raise ImportError("torchtext C++ Extension is not found.")
ImportError: torchtext C++ Extension is not found.

Could anyone point me how can I use torchtext with torch 2.0.0 ?

joecummings commented 1 year ago

When building from source, you need to build torchdata from source, too. See instructions that were added in this PR: #2048

cc @ejguan @Nayef211