https://github.com/SeanNaren/warp-ctc
下载下来,解压
mkdir build
cd build
cmake ../
make 出错 ,还以为是代码问题,换了5.5版本的gcc成功编译
cd pytorch_binding
python setup.py install 出错
报cublas_v2.h: No such file or directory
保证cuda正常安装
.bashrc里的路径添加正确
.bashrc末尾加下如下语句
export WARP_CTC_PATH=/home/dell/setup/warp-ctc/build/
export PATH=/usr/local/cuda-10.1/bin:$PATH
export PATH=/usr/local/cuda-10.1/include:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH
注意路径里的cuda版本,如果是10.0版本,10.1要改成10.0,WARP_CTC安装文件的路径要对
成功执行
调用:
from warpctc_pytorch import CTCLoss
ctc_loss = CTCLoss()