我正在尝试使用 torchtext 中的 torchtext.data.Field() 但它无法以我尝试过的任何方式工作。
我尝试过
from torchtext.legacy import data
但似乎不起作用。我还尝试通过运行 pip install torchtext==0.10.0
安装另一个版本的 torchtext(当前有 0.16.2),但我在终端中收到此错误消息
ERROR: Could not find a version that satisfies the requirement torchtext==0.10.0 (from versions: 0.1.1, 0.2.0, 0.2.1, 0.2.3, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.16.2)
ERROR: No matching distribution found for torchtext==0.10.0
以前有人遇到过这个错误吗?
我使用的是Python版本3.12.1的conda环境,我的torch版本是2.2.0。
torchtext
直到python 3.11
https://pypi.org/project/torchtext/
您需要降级到
python 3.11
或单独安装python 3.11
才能使用torchtext