5

Why can't torchtext find this symbol?

(synthesis) miranda9~/ultimate-utils $ python ~/type-parametric-synthesis/src/main.py --reproduce_10K --serial --debug --num_workers 0



Traceback (most recent call last):
  File "/home/miranda9/type-parametric-synthesis/src/main.py", line 32, in <module>
    from data_pkg.data_preparation import get_dataloaders, get_simply_type_lambda_calc_dataloader_from_folder
  File "/home/miranda9/type-parametric-synthesis/src/data_pkg/data_preparation.py", line 10, in <module>
    from torchtext.vocab import Vocab, vocab
  File "/home/miranda9/miniconda3/envs/synthesis/lib/python3.9/site-packages/torchtext/__init__.py", line 5, in <module>
    from . import vocab
  File "/home/miranda9/miniconda3/envs/synthesis/lib/python3.9/site-packages/torchtext/vocab.py", line 13, in <module>
    from torchtext._torchtext import (
ImportError: /home/miranda9/miniconda3/envs/synthesis/lib/python3.9/site-packages/torchtext/_torchtext.so: undefined symbol: _ZN2at6detail10noopDeleteEPv

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
  • perhaps more useful: https://stackoverflow.com/questions/69229975/how-does-one-install-torchtext-with-cuda-11-0-and-pytorch-1-9 – Charlie Parker Sep 17 '21 at 22:32

4 Answers4

3

Reinstall torchtext with the current version of pytorch:

e.g.

conda install -y torchtext -c pytorch

or for older versions of pytorch torchtext ImportError in colab

conda install -y torchtext==0.8.0 -c pytorch

Though in general it seems in my experience that torchtext install the right version of pytorch on its own...

Ref: https://github.com/PyTorchLightning/pytorch-lightning/issues/4533

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
1
pip install -U torchtext

If you are using official distribution, torchtext 0.12 and torch 1.12 are incompatible and this result is expected. Please see https://github.com/pytorch/text#installation for the correct combination.

1

pip uninstall torchtext pip install torchtext

Hani
  • 21
  • 2
0

I got a similar undefined symbol: _ZTVN5torch3jit6MethodE problem.

I solved it by remaking (make -j10) the whole project (some c++ programs involved).

A possible reason could be that I reinstalled CUDA with a different version and this kind of change affected the environment (context or something).

Just some random idea... hope you can get some spirit.

sirius
  • 567
  • 6
  • 26