s4d——语音分离代码环境搭建(二)
语音分离代码环境搭建(二)
备注:此处仅仅是个人做的一个环境搭建记录
该环境 Linux 下 可以轻易搭建成功。
ecyglpki 这个库的安装需要 C++ 环境。
win10下 安装ecyglpki时,报 **Microsoft Visual C++ 14.0 is required.**的错误,因此安装C++环境才可以继续该库的安装。
s4d源代码仓库链接
SIDEKIT for diarization documentation
官方安装教程
官网链接
conda create -n mysep355 python=3.5.5
pip install --upgrade pip
先安装这个 可以自动安装 numpy==1.13.3
conda install scipy==0.19.0
可以自动安装 six==1.11.0
conda install pandas==0.21.1
conda install PyAudio==0.2.11
conda install matplotlib==2.0.2
conda install Bottleneck==1.2.1
conda install sortedcontainers==1.5.9
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
conda无法安装:
conda install setuptools==38.5.2
conda install ecyglpki==0.2.0
conda install sidekit==1.2.3
conda install scikit_learn==0.19.1
- 1
- 2
- 3
- 4
然后使用pip安装
pip3 install setuptools==38.5.2
pip3 install sidekit==1.2.3
pip3 install scikit_learn==0.19.1
- 1
- 2
- 3
- 4
- 5
- 6
pip3 install ecyglpki==0.2.0
- 我第一次安装失败,缺少gcc
apt-get install g++
- 1
- 第二次安装缺少glpk,报错如下:
ecyglpki.c:247:18: fatal error: glpk.h: No such file or directory
#include "glpk.h"
- 1
- 2
解决方法(一),该方法我的阿里云服务器是失败的:
glpk是一个开源的求解线性规划的包。
添加源:
deb http://us.archive.ubuntu.com/ubuntu saucy main universe
更新源并安装:
sudo apt-get update
sudo apt-get install glpk
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
解决方法二-源码安装,我尝试成功:
glpk官方源码安装方法
glpk下载地址
个人总结的glpk安装教程简记
解压源码:
./configure
make
make install
安装的默认路径是/usr/local/lib,安装完成
- 1
- 2
- 3
- 4
- 5
- 第三次ecyglpki才安装成功,如下:
pip3 install ecyglpki==0.2.0
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/, https://pypi.python.org/simple
Collecting ecyglpki==0.2.0
Downloading http://mirrors.aliyun.com/pypi/packages/39/7a/5a1e87367ef826985e55f53c5ceff5476349b7cc26ab5e5cb23fd4e7273b/ecyglpki-0.2.0.tar.gz (365kB)
100% |████████████████████████████████| 368kB 81.3MB/s
Building wheels for collected packages: ecyglpki
Building wheel for ecyglpki (setup.py) ... done
Stored in directory: /root/.cache/pip/wheels/4c/11/87/fdf58295bb58a52a7062aecc2d3d7a5c8e462037ffde72de0d
Successfully built ecyglpki
Installing collected packages: ecyglpki
Successfully installed ecyglpki-0.2.0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
运行程序,错误解决过程:
运行命令如下:
cd s4d-master/
./install.sh
- 1
- 2
- 处理两个 警告 的方法
conda install mkl-service
- 1
libsvm.so生成方法链接
按照说明 copy libsvm.so.2到conda 建立的这个独立环境的库中的sidekit下libsvm目录下即可
cp libsvm.so.2 /home/zql/anaconda3/envs/mysep355/lib/python3.5/site-packages/sidekit/libsvm
- 1
- 报错一:
RuntimeError:
To use MKL 2018 with Theano either update the numpy conda packages to
their latest build or set "MKL_THREADING_LAYER=GNU" in your
environment.
- 1
- 2
- 3
- 4
- 报错二:
Import theano
ERROR (theano.gpuarray): pygpu was configured but could not be imported or is too old (version 0.7 or higher required)
NoneType: None
- 1
- 2
- 3
安装pygpu
conda install pygpu
- 1
- 报错三,因为已经安装了cuda,报错说不支持:
Import theano
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "/root/anaconda3/envs/mysep355/lib/python3.5/site-packages/theano/gpuarray/__init__.py", line 227, in <module>
use(config.device)
File "/root/anaconda3/envs/mysep355/lib/python3.5/site-packages/theano/gpuarray/__init__.py", line 214, in use
init_dev(device, preallocate=preallocate)
File "/root/anaconda3/envs/mysep355/lib/python3.5/site-packages/theano/gpuarray/__init__.py", line 99, in init_dev
**args)
File "pygpu/gpuarray.pyx", line 658, in pygpu.gpuarray.init
File "pygpu/gpuarray.pyx", line 587, in pygpu.gpuarray.pygpu_init
pygpu.gpuarray.GpuArrayException: b'cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
那就压缩,copy到有gpu的服务器使用
zip -r mysep355.zip mysep355
- 1
备注:
-
我按照上面的安装流程,在一台纯净的Ubuntu服务器搭建该环境OK
-
theano库的安装和import使用需要cuda、cudnn、GPU,正确配置 cuda
cuda配置如下:
#<<< config root's cuda start <<<
export PATH=/usr/local/cuda-8.0/bin:$PATH
export CUDA_HOME=/usr/local/cuda-8.0/bin:$CUDA_HOME
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH
#<<< config root's cuda end <<<
- 1
- 2
- 3
- 4
- 5
- 6
- 7
.bashrc 环境变量配置文件在当前用户目录下
vim .bashrc
把上面cuda的配置copy到最下面,指定你要使用的cuda的目录,即可
- 1
- 2
然后使用source命令使配置生效
source .bashrc
root 账户 source命令方式:
source ~/.bashrc
- 1
- 2
- 3
后续调试,更新的库如下:
- 错误如下:
from tabulate import tabulate
ImportError: No module named 'tabulate'
- 1
- 2
- 3
于是安装tabulate即可
pip install tabulate
- 1
文章来源: positive.blog.csdn.net,作者:墨理学AI,版权归原作者所有,如需转载,请联系作者。
原文链接:positive.blog.csdn.net/article/details/86741442
- 点赞
- 收藏
- 关注作者
评论(0)