0

I am getting the following error when importing StatefulUnidirectionalLSTM from pytorch_stateful_lstm :

  File "<input>", line 1, in <module>
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/user/PycharmProjects/venv/lib/python3.7/site-packages/pytorch_stateful_lstm/__init__.py", line 11, in <module>
    from _pytorch_stateful_lstm import (
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: dlopen(/Users/user/PycharmProjects/venv/lib/python3.7/site-packages/_pytorch_stateful_lstm.cpython-37m-darwin.so, 2): Symbol not found: __ZN3c1019UndefinedTensorImpl10_singletonE
  Referenced from: /Users/user/PycharmProjects/venv/lib/python3.7/site-packages/_pytorch_stateful_lstm.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Users/user/PycharmProjects/venv/lib/python3.7/site-packages/_pytorch_stateful_lstm.cpython-37m-darwin.so

My environment information is:

Is debug build: No
CUDA used to build PyTorch: None

OS: Mac OSX 10.14.6
GCC version: Could not collect
CMake version: Could not collect

Python version: 3.7
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip3] numpy==1.18.2
[pip3] pytorch-fast-elmo==0.6.12
[pip3] pytorch-stateful-lstm==1.6.0
[pip3] torch==1.0.1.post2
[conda] Could not collect

Has any one encountered this error and how to fix it?

laila
  • 1,009
  • 3
  • 15
  • 27
  • when do you get the error? while installing or importing? Also, post the full error message with the code that may be causing this. – Zabir Al Nazi Apr 21 '20 at 14:58
  • updated with full error message. The error arises when importing. – laila Apr 21 '20 at 15:05
  • some version mismatch, maybe you need to recompile. Check if it helps https://stackoverflow.com/questions/35006614/what-does-symbol-not-found-expected-in-flat-namespace-actually-mean – Zabir Al Nazi Apr 21 '20 at 15:08
  • thanks. I tried but get the same error. – laila Apr 21 '20 at 15:18

0 Answers0