warp-ctc icon indicating copy to clipboard operation
warp-ctc copied to clipboard

import error

Open as754770178 opened this issue 4 years ago • 5 comments

when I exec import, report error:

# In SeanNaren/warp-ctc/pytorch_binding 
>>> from warpctc_pytorch import CTCLoss
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/110482/code/lstm/SeanNaren/warp-ctc/pytorch_binding/warpctc_pytorch/__init__.py", line 6, in <module>
    from ._warp_ctc import *
ModuleNotFoundError: No module named 'warpctc_pytorch._warp_ctc'
>>> 
>>> import warpctc_pytorch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/110482/code/lstm/SeanNaren/warp-ctc/pytorch_binding/warpctc_pytorch/__init__.py", line 6, in <module>
    from ._warp_ctc import *
ModuleNotFoundError: No module named 'warpctc_pytorch._warp_ctc'
>>>

# In other file report
>>> from warpctc_pytorch import CTCLoss
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/lib/python3.7/site-packages/warpctc_pytorch-0.1-py3.7-linux-x86_64.egg/warpctc_pytorch/__init__.py", line 6, in <module>
    from ._warp_ctc import *
ImportError: /opt/anaconda3/lib/python3.7/site-packages/warpctc_pytorch-0.1-py3.7-linux-x86_64.egg/warpctc_pytorch/_warp_ctc.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN2at19NonVariableTypeMode10is_enabledEv

as754770178 avatar Sep 04 '19 11:09 as754770178

my gcc version is 4.9.0

# The result of `python3 setup.py install`
running install_lib
running build_py
running build_ext
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/warpctc_pytorch
copying build/lib.linux-x86_64-3.7/warpctc_pytorch/_warp_ctc.cpython-37m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/warpctc_pytorch
copying build/lib.linux-x86_64-3.7/warpctc_pytorch/__init__.py -> build/bdist.linux-x86_64/egg/warpctc_pytorch
byte-compiling build/bdist.linux-x86_64/egg/warpctc_pytorch/__init__.py to __init__.cpython-37.pyc
creating stub loader for warpctc_pytorch/_warp_ctc.cpython-37m-x86_64-linux-gnu.so
byte-compiling build/bdist.linux-x86_64/egg/warpctc_pytorch/_warp_ctc.py to _warp_ctc.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying warpctc_pytorch.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying warpctc_pytorch.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying warpctc_pytorch.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying warpctc_pytorch.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
warpctc_pytorch.__pycache__._warp_ctc.cpython-37: module references __file__
creating 'dist/warpctc_pytorch-0.1-py3.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing warpctc_pytorch-0.1-py3.7-linux-x86_64.egg
removing '/opt/anaconda3/lib/python3.7/site-packages/warpctc_pytorch-0.1-py3.7-linux-x86_64.egg' (and everything under it)
creating /opt/anaconda3/lib/python3.7/site-packages/warpctc_pytorch-0.1-py3.7-linux-x86_64.egg
Extracting warpctc_pytorch-0.1-py3.7-linux-x86_64.egg to /opt/anaconda3/lib/python3.7/site-packages
warpctc-pytorch 0.1 is already the active version in easy-install.pth

Installed /opt/anaconda3/lib/python3.7/site-packages/warpctc_pytorch-0.1-py3.7-linux-x86_64.egg
Processing dependencies for warpctc-pytorch==0.1
Finished processing dependencies for warpctc-pytorch==0.1

as754770178 avatar Sep 04 '19 11:09 as754770178

The end result of make:

Scanning dependencies of target warpctc
Linking CXX shared library libwarpctc.so
[ 33%] Built target warpctc
[ 50%] Scanning dependencies of target test_cpu
Building NVCC (Device) object CMakeFiles/test_gpu.dir/tests/./test_gpu_generated_test_gpu.cu.o
[ 66%] [ 83%] Building CXX object CMakeFiles/test_cpu.dir/tests/test_cpu.cpp.o
Building CXX object CMakeFiles/test_cpu.dir/tests/random.cpp.o
Linking CXX executable test_cpu
[ 83%] Built target test_cpu
Scanning dependencies of target test_gpu
[100%] Building CXX object CMakeFiles/test_gpu.dir/tests/random.cpp.o
Linking CXX executable test_gpu
[100%] Built target test_gpu

as754770178 avatar Sep 04 '19 11:09 as754770178

I meet the same problem!!!

psnow avatar Oct 16 '19 01:10 psnow

same here

HuimengZhang avatar Dec 03 '19 04:12 HuimengZhang

u can try this https://github.com/SeanNaren/warp-ctc/pull/31#issuecomment-475464553

lhn217 avatar Dec 26 '19 03:12 lhn217