Facebook 开源语音识别工具包wav2letter 环境搭建,以及遇到的问题

本次的安装环境:

ubuntu 16.04

 

MKL 的安装

地址:https://software.intel.com/en-us/mkl/choose-download/linux

Intel® oneAPI Base Toolkit安装:

wget https://registrationcenter- download.intel.com/akdlm/irc_nas/17769/l_BaseKit_p_2021.2.0.2883.sh

sudo bash l_BaseKit_p_2021.2.0.2883.sh

 

Intel® oneAPI HPC Toolkit安装:

wget https://registrationcenter-download.intel.com/akdlm/irc_nas/17764/l_HPCKit_p_2021.2.0.2997.sh

sudo bash l_HPCKit_p_2021.2.0.2997.sh

 

环境变量的设置:

vi ~/.bashrc

export MKL_INC_DIR=/opt/intel/oneapi/mkl/2021.2.0/include

export INTEL_DIR=/opt/intel/oneapi/mkl/2021.2.0/lib/intel64

export MKL_DIR=/opt/intel/oneapi/mkl/2021.2.0/lib/intel64

export MKLDNN_INC_DIR=/opt/intel/oneapi/mkl/2021.2.0/include

export MKLDNN_LIB_DIR=/opt/intel/oneapi/dnnl/2021.2.0/lib

export MKLDNN_ROOT=/opt/intel/oneapi/dnnl

export CMAKE_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLDNN_LIB_DIR

export CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH:$MKLDNN_INC_DIR:$MKL_INC_DIR

source ~/.bashrc

sudo ldconfig

 

Boost 安装

wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz

tar zxvf boost_1_71_0.tar.gz

cd boost_1_71_0

./bootstrap.sh

sudo ./b2 install

 

XZ安装

wget https://tukaani.org/xz/xz-5.2.4.tar.gz

tar xzvf xz-5.2.4.tar.gz

cd xz-5.2.4

./configure

make

sudo make install

 

ZLib安装

wget http://zlib.net/zlib-1.2.11.tar.gz

tar xzf zlib-1.2.11.tar.gz

cd zlib-1.2.11

./configure

make

sudo make install

 

bzip安装

git clone git://sourceware.org/git/bzip2.git

cd bzip2

make

sudo make install

 

libbz2-dev安装

sudo apt-get install libbz2-dev

 

Eigen3安装

地址:http://eigen.tuxfamily.org/index.php?title=Main_Page

本次下载的版本是 eigen-3.2.9.tar.gz

sudo tar -xzvf eigen-3.2.9.tar.gz -C /usr/local/include

sudo mv /usr/local/include/eigen-3.2.9 /usr/local/include/eigen3

sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include

 

环境变量

vim ~/.bashrc

export Eigen3_DIR=/home/maoding/Downloads/eigen-3.2.9

source ~/.bashrc

 

kenlm安装

wget -O - https://kheafield.com/code/kenlm.tar.gz |tar xz

mkdir kenlm/build

cd kenlm/build

cmake ..

make -j2

cd ../..

sudo cp -r kenlm /opt

 

环境变量

vi ~/.bashrc

export KENLM_ROOT_DIR=/opt/kenlm

export CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH: $KENLM_ROOT_DIR

source ~/.bashrc

sudo ldconfig

 

gflags 安装

sudo apt-get install libgflags-dev

 

google test 安装

git clone https://github.com/google/googletest.git

mkdir googletest/build

cd googletest /build

cmake ..

make

sudo make install

 

fftw 安装

sudo apt-get install fftw3

 

libsndfile 安装

git clone git://github.com/erikd/libsndfile.git

sudo apt install autoconf autogen automake build-essential libasound2-dev libflac-dev libogg-dev libtool libvorbis-dev pkg-config python libopus-dev

cd libsndfile

./autogen.sh

./configure --enable-werror

make

make check

sudo make install

 

CUDA 和CUDNN 的安装

CUDA 10.0 下载地址:https://developer.nvidia.com/cuda-toolkit-archive

CUDNN 7.6.5 下载地址:https://developer.nvidia.com/rdp/cudnn-download

 

sudo sh cuda_10.0.130_410.48_linux.run

解压cudnn的下载文件

sudo cp cuda/include/cudnn.h /usr/local/cuda/include

sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64

sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

 

环境变量

export CUDNN_LIBRARY=/usr/local/cuda-10.0/lib64

export CUDNN_INCLUDE_DIR=/usr/local/cuda-10.0/include

export PATH=/usr/local/cuda-10.0/bin:$PATH

 

ArrayFire 安装

sudo apt-get install -y build-essential git cmake libfreeimage-dev

sudo apt-get install -y cmake-curses-gui

sudo apt-get install libopenblas-dev libfftw3-dev liblapacke-dev

sudo apt-get install libglfw3-dev libfontconfig1-dev libglm-dev

sudo apt-get install doxygen

sudo apt install graphviz

 

git clone https://github.com/Reference-LAPACK/lapack.git

cd lapack

mkdir build && cd build

cmake ..

make -j 4

sudo make install

 

git clone --recursive https://github.com/arrayfire/arrayfire.git

cd arrayfire

mkdir build && cd build

cmake .. -DCMAKE_BUILD_TYPE=Release

make -j 4

sudo make install

 

NCCL 安装

下载地址:https://developer.nvidia.com/nccl/nccl-download

sudo dpkg -i nccl-local-repo-ubuntu1604-2.8.4-cuda10.2_1.0-1_amd64.deb

sudo apt-get update

 

OpenMPI 安装

wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.2.tar.gz

tar zxvf openmpi-4.0.2.tar.gz

cd openmpi-4.0.2

./configure

make -j4

sudo make install

 

vi ~/.bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/openmpi/

sudo ldconfig

mpirun

 

Gloo 安装

git clone https://github.com/facebookincubator/gloo.git

cd gloo

mkdir build && cd build

cmake ..

make

sudo make install

 

flashlight安装

git clone https://github.com/facebookresearch/flashlight.git

mkdir build && cd build

cmake .. -DCMAKE_BUILD_TYPE=Release -DFLASHLIGHT_BACKEND=CUDA

make -j4

make test

sudo make install

 

wav2letter++安装

git clone --recursive https://github.com/facebookresearch/wav2letter.git

cd wav2letter

mkdir build && cd build

cmake .. -DCMAKE_BUILD_TYPE=Release

make -j8

 

遇到的问题以及解决方案:

1、Eigen3 找不到

-- Could NOT find Eigen3 (missing: Eigen3_DIR)

-- Boost 1.41.0 found.

-- Found Boost components:

program_options;system;thread;unit_test_framework

-- Configuring done

-- Generating done

-- Build files have been written to: /home/maoding/Downloads/kenlm/build

 

解决:配置Eigen3_DIR 环境变量

 

2、-lpthreads cannot find

/usr/bin/ld: cannot find -lpthreads

collect2: error: ld returned 1 exit status

CMakeFiles/cmTC_27e77.dir/build.make:86: recipe for target 'cmTC_27e77' failed

make[1]: *** [cmTC_27e77] Error 1

make[1]: Leaving directory '/home/maoding/Downloads/wav2letter/build/CMakeFiles/CMakeTmp'

Makefile:121: recipe for target 'cmTC_27e77/fast' failed

make: *** [cmTC_27e77/fast] Error 2

 

解决:set(CMAKE_CXX_FLAGS "${CAMKE_CXX_FLAGS} -std=c++11 -lpthread")

 

3、找不到依赖的路径 例如 Could NOT find CUDNN (missing: CUDNN_LIBRARY CUDNN_INCLUDE_DIR) #16380

 

解决:反复确认相关依赖 是否安装 如果已经安装,找build 下 CMakeCache.txt 相关路径是否添加,添加后重新编译就可。

欢迎关注、点赞、收藏、留言,一起讨论学习,共同成长。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(AI,神经网络,机器学习)