thu-spmi / CAT

A CRF-based ASR Toolkit
Apache License 2.0
325 stars 74 forks source link

安装到最后,Test CTC-CRF installation时出错 #74

Closed DLKKILL closed 4 months ago

DLKKILL commented 1 year ago
Test CTC-CRF installation:
Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import ctc_crf
  File "/root/miniconda3/lib/python3.8/site-packages/ctc_crf-0.1.1-py3.8-linux-x86_64.egg/ctc_crf/__init__.py", line 15, in <module>
    import ctc_crf._C as core
ImportError: /root/miniconda3/lib/python3.8/site-packages/ctc_crf-0.1.1-py3.8-linux-x86_64.egg/ctc_crf/_C.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN2at5emptyEN3c108ArrayRefIlEENS0_13TensorOptionsENS0_8optionalINS0_12MemoryFormatEEE
failed to install cat.

可以帮忙看一下是什么原因吗

maxwellzh commented 1 year ago

请问使用的 torch 版本是什么?

DLKKILL commented 1 year ago

请问使用的 torch 版本是什么?

你好,torch 1.13.0+cu117

maxwellzh commented 1 year ago

抱歉,这个问题我也没遇到过,我使用的 torch / cuda 和你是一致的。能否尝试手动重新安装

cd src/ctc_crf
python setup.py develop

然后再测试

# under src/ctc_crf
cd test
python main.py
DLKKILL commented 1 year ago

抱歉,这个问题我也没遇到过,我使用的 torch / cuda 和你是一致的。能否尝试手动重新安装

cd src/ctc_crf
python setup.py develop

然后再测试

# under src/ctc_crf
cd test
python main.py

你好,我试了试下还是不可以

我尝试执行 ldd -r /root/miniconda3/lib/python3.8/site-packages/ctc_crf-0.1.1-py3.8-linux-x86_64.egg/ctc_crf/_C.cpython-38-x86_64-linux-gnu.so 部分结果如下:

linux-vdso.so.1 (0x00007ffcf0bfc000)
        libfst_den.so => /root/ctc-crf/CAT/src/ctc_crf/gpu_den/build/libfst_den.so (0x00007efe64068000)
        libwarpctc.so => /root/ctc-crf/CAT/src/ctc_crf/gpu_ctc/build/libwarpctc.so (0x00007efe63919000)
        libc10.so => not found
        libtorch.so => not found
        libtorch_cpu.so => not found
        libtorch_python.so => not found
        libstdc++.so.6 => /root/miniconda3/lib/libstdc++.so.6 (0x00007efe643ab000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007efe6357b000)
        libgcc_s.so.1 => /root/miniconda3/lib/libgcc_s.so.1 (0x00007efe64397000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efe6335c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efe62f6b000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007efe62d67000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007efe62b5f000)
        libfst_read.so => /root/ctc-crf/CAT/src/ctc_crf/gpu_den/build/libfst_read.so (0x00007efe62940000)
        /lib64/ld-linux-x86-64.so.2 (0x00007efe64336000)
        libfst.so.10 => /root/ctc-crf/CAT/src/ctc_crf/openfst-1.6.7/build/lib/libfst.so.10 (0x00007efe621d6000)
undefined symbol: PyInstanceMethod_Type (/root/miniconda3/lib/python3.8/site-packages/ctc_crf-0.1.1-py3.8-linux-x86_64.egg/ctc_crf/_C.cpython-38-x86_64-linux-gnu.so)
undefined symbol: _ZN3c1019UndefinedTensorImpl10_singletonE     (/root/miniconda3/lib/python3.8/site-packages/ctc_crf-0.1.1-py3.8-linux-x86_64.egg/ctc_crf/_C.cpython-38-x86_64-linux-gnu.so)
undefined symbol: PyExc_RuntimeError    (/root/miniconda3/lib/python3.8/site-packages/ctc_crf-0.1.1-py3.8-linux-x86_64.egg/ctc_crf/_C.cpython-38-x86_64-linux-gnu.so)

可能需要重新安装libtorch,我再手动安装一下试试吧

thu-spmi commented 4 months ago

solved