pytorch-sentiment-analysis icon indicating copy to clipboard operation
pytorch-sentiment-analysis copied to clipboard

OSError: /usr/local/lib/python3.6/dist-packages/torchtext/_torchtext.so: undefined symbol:

Open vastech73 opened this issue 4 years ago • 5 comments

I am trying to run your exercise and i am seeing this issue. Is there a known hack for this ? root@supermicro-2xvega20:~/pytorch-sentiment-analysis# python3 4\ -\ Convolutional\ Sentiment\ Analysis.py Traceback (most recent call last): File "4 - Convolutional Sentiment Analysis.py", line 30, in from torchtext import data File "/usr/local/lib/python3.6/dist-packages/torchtext/init.py", line 40, in _init_extension() File "/usr/local/lib/python3.6/dist-packages/torchtext/init.py", line 36, in _init_extension torch.ops.load_library(ext_specs.origin) File "/root/.local/lib/python3.6/site-packages/torch/_ops.py", line 105, in load_library ctypes.CDLL(path) File "/usr/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: /usr/local/lib/python3.6/dist-packages/torchtext/_torchtext.so: undefined symbol: _ZN5torch3jit6MethodclESt6vectorIN3c106IValueESaIS4_EERKSt13unordered_mapISsS4_St4hashISsESt8equal_toISsESaISt4pairIKSsS4_EEE

vastech73 avatar Nov 11 '20 04:11 vastech73

What version of PyTorch and torchtext are you using? You need to ensure they match up, see the version compatibility table in the README of https://github.com/pytorch/text.

I believe this issue is because you need PyTorch >=1.6

bentrevett avatar Nov 11 '20 17:11 bentrevett

I have the latest versions that are supposed to be compatible, but still get this error. PyTorch 1.7.1 and torchtext 0.8.1.

NA-Dev avatar Mar 23 '21 20:03 NA-Dev

@NA-Dev Do you still get the error with PyTorch 1.8 and torchtext 0.9? I think torchtext has had some issues with their binaries.

bentrevett avatar Mar 25 '21 12:03 bentrevett

I had the same issue - upgraded to PyTorch 1.8 and torchtext 0.9 as suggested above. This fixed the problem.

adieyal avatar Apr 03 '21 10:04 adieyal

Ive been having this issue on azure. Here is the conda spec that finally worked for me:

channels:
  - default
  - conda-forge
  - pytorch
dependencies:
  - pip>20.1
  - python>=3.7,<3.9
  - pytorch=1.8.0
  - torchtext=0.9
  - pip:
    - torch==1.8
    - transformers==4.11.0
    - torchmetrics==0.5.1
    - spacy==3.1.3
    - pandas==1.3.3
    - pytorch_lightning==1.4.8
    - azureml-core>=1.31.0
    - tqdm>=4.59,<4.60

jmerkow avatar Oct 04 '21 01:10 jmerkow