安装ctcdecode,pytorch大于1.4(1.5以上版本)

需要从源码进行编译安装,源码可以从GitHub或者这个人的博客获取源码文件,或者直接

https://pan.baidu.com/s/1sZMbzzYtBoT35zHtDifVqQ ,提取码:a05y。下载解压后可直接安装

chttps://blog.csdn.net/u011550545/article/details/87926995?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167024930916800215041715%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=167024930916800215041715&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-87926995-null-null.142^v67^wechat_v2,201^v4^add_ask,213^v2^t3_esquery_v1&utm_term=ctcdecode%E5%AE%89%E8%A3%85&spm=1018.2226.3001.4187

 将他的build.py文件中的compile_args = ['-O3', '-DKENLM_MAX_ORDER=6', '-std=c++11', '-fPIC']

替换为compile_args = ['-O3', '-DKENLM_MAX_ORDER=6', '-std=c++14', '-fPIC']

即将编译器换为c++14,亲测有用

然后执行

python setup.py bdist_wheel

或者pip install .

我的安装环境pytorch1.8

ubuntu 18,04

你可能感兴趣的:(python,pip)