[issue] ImportError:/xxxx/torchtext/_torchtext.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtER

[issue]

pip install torchtext时,torch会随之自动更新,torchtext 运行成功,但是在调用torchtext库时,会报错以上。

[solution]

网上百度是torch、python、cuda、torchtext版本不对应导致的。

  1. 查询python 和torch版本:终端输入
    pip list
  2. 查询cuda版本:
    nvcc -V
  3. 查询匹配版本:
    torchtext版本对应
  4. 基于上述版本,对应:
    pip install torchtext==xxx

猜你喜欢

转载自blog.csdn.net/zqwwwm/article/details/123201681