text icon indicating copy to clipboard operation
text copied to clipboard

torchtext main branch doesn't support pytorch2.0

Open YangQun1 opened this issue 2 years ago • 1 comments

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 ?

YangQun1 avatar Feb 10 '23 02:02 YangQun1

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

cc @ejguan @Nayef211

joecummings avatar Feb 10 '23 20:02 joecummings