需要从源码进行编译安装,源码可以从GitHub或者这个人的博客获取源码文件,或者直接
https://pan.baidu.com/s/1sZMbzzYtBoT35zHtDifVqQ ,提取码:a05y。下载解压后可直接安装
将他的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