Update install.md (#1127)

test=doc_fix
pull/1139/head
Jackwaterveg 3 years ago committed by GitHub
parent f9efbf3063
commit 06d7628683
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,31 +1,35 @@
# Installation # Installation
There are 3 ways to use `PaddleSpeech`. According to the degree of difficulty, the 3 ways can be divided into **Easy**, **Medium** and **Hard**. You can choose one of the 3 ways to install `PaddleSpeech`. There are 3 ways to use `PaddleSpeech`. According to the degree of difficulty, the 3 ways can be divided into **Easy**, **Medium** and **Hard**. You can choose one of the 3 ways to install `PaddleSpeech`.
| Way | Function | | Way | Function | Support|
| :---- | :----------------------------------------------------------- | | :---- | :----------------------------------------------------------- |:----|
| Easy | (1) Use command line functions of PaddleSpeech. <br> (2) Experience PaddleSpeech on Aistudio. | | Easy | (1) Use command line functions of PaddleSpeech. <br> (2) Experience PaddleSpeech on Ai Studio. | Linux, MacWindows |
| Medium | Support major functionsuch as using the` ready-made `examples and using PaddleSpeech to train your own model. | | Medium | Support major functionsuch as using the` ready-made `examples and using PaddleSpeech to train your own model. | Linux |
| Hard | Support full function of Paddlespeechincluding training n-gram language model. And you are more able be a developer! | | Hard | Support full function of Paddlespeechincluding training n-gram language model, montreal-forced-aligner and so on. And you are more able be a developer! | Ubuntu |
## Prerequisites ## Prerequisites
- Python >= 3.7 - Python >= 3.7
- PaddlePaddle latest version (please refer to the [Installation Guide](https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/index_en.html)) - PaddlePaddle latest version (please refer to the [Installation Guide] (https://www.paddlepaddle.org.cn/documentation/docs/en/beginners_guide/index_en.html))
- Hip: For Linux and Mac, do not use command `sh` instead of command `bash` - C++ compilation environment
- Hip: For Linux and Mac, do not use command `sh` instead of command `bash` in installation document.
## Easy: Get the Basic Function (Support Linux, Mac and Windows) ## Easy: Get the Basic Function (Support Linux, Mac and Windows)
- If you are newer to `PaddleSpeech` and want to experience it easily without your own machine. We recommend you to use [AI Studio](https://aistudio.baidu.com/aistudio/index) to experience it. There is a step-by-step tutorial for `PaddleSpeech` and you can use the basic function of `PaddleSpeech` with a free machine. - If you are newer to `PaddleSpeech` and want to experience it easily without your own machine. We recommend you to use [AI Studio](https://aistudio.baidu.com/aistudio/index) to experience it. There is a step-by-step tutorial for `PaddleSpeech` and you can use the basic function of `PaddleSpeech` with a free machine.
- If you want to use the command line function of Paddlespeech, you need to complete the following steps to install `PaddleSpeech`. For more information about how to use command line function , you can see the [cli](https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/paddlespeech/cli).
### Install Conda ### Install Conda
Conda is a management system of the environment. You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) to install the conda. Conda is a management system of the environment. You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) (select a version py>=3.7) to download and install the conda.
And then Install conda dependencies for `paddlespeech` : And then Install conda dependencies for `paddlespeech` :
```bash ```bash
conda install -y -c conda-forge sox libsndfile swig bzip2 conda install -y -c conda-forge sox libsndfile bzip2
``` ```
### Install C++ environment ### Install C++ Compilation Environment
(If you already have C++ compilation environment, you can miss this step.)
#### Windows #### Windows
Since some required pypi packages need C++ environment, you need to install the visual studio firstly. You need to install the `Visual Studio` to make the C++ compilation environment.
#### Mac #### Mac
```bash ```bash
@ -51,11 +55,9 @@ You can use the following command:
pip install paddlepaddle paddlespeech pip install paddlepaddle paddlespeech
``` ```
- You can use the command line function of Paddlespeech. For more information, you can see the [cli](https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/paddlespeech/cli).
## Medium: Get the Major Function (Support Linux) ## Medium: Get the Major Function (Support Linux)
If you want to get the major function of `paddlespeech`. There are 3 steps you need to do. If you want to get the major function of `paddlespeech`. There are 4 steps you need to do.
### Install Conda ### Install Conda
Conda is a management system of the environment. You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) to select a version (py>=3.7) and install it by yourself or you can use the following command: Conda is a management system of the environment. You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) to select a version (py>=3.7) and install it by yourself or you can use the following command:
@ -81,8 +83,10 @@ Install conda dependencies for `paddlespeech` :
```bash ```bash
conda install -y -c conda-forge sox libsndfile swig bzip2 conda install -y -c conda-forge sox libsndfile swig bzip2
``` ```
### Install C++ Compilation Environment
(If you already have C++ compilation environment, you can miss this step.)
Do not forget to install `gcc` and `gxx` on your system. Do not forget to install `gcc` and `gxx` on your system.
If you use linux, you can choose to use the scripts below to install them. You can choose to use the scripts below to install them.
```bash ```bash
# centos # centos
@ -98,23 +102,24 @@ conda install -y -c gcc_linux-64=8.4.0 gxx_linux-64=8.4.0
``` ```
(Hip: Do not use the last script if you want to install by **Hard** way): (Hip: Do not use the last script if you want to install by **Hard** way):
### Install PaddlePaddle ### Install PaddlePaddle
For example, for CUDA 10.2, CuDNN7.5 install paddle 2.2.0: You can choose the `PaddlePaddle` version based on your system. For example, for CUDA 10.2, CuDNN7.5 install paddlepaddle-gpu 2.2.0:
```bash ```bash
python3 -m pip install paddlepaddle-gpu==2.2.0 python3 -m pip install paddlepaddle-gpu==2.2.0
``` ```
### Install PaddleSpeech ### Install PaddleSpeech
If you want to use the` ready-made `examples in `paddlespeech`, you need to clone this repository and install `paddlespeech` by the following commands: You need to `git clone` this repository and install `paddlespeech` by the following commandsthen you can use the `ready-made` examples in `paddlespeech` :
```bash ```bash
https://github.com/PaddlePaddle/PaddleSpeech.git https://github.com/PaddlePaddle/PaddleSpeech.git
cd PaddleSpeech cd PaddleSpeech
pip install . pip install .
``` ```
## Hard: Get the Full Function on Your Machine ## Hard: Get the Full Function (Support Ubuntu)
### Prerequisites ### Prerequisites
- Ubuntu >= 16.04.
- choice 1: working with `Ubuntu` Docker Container. - choice 1: working with `Ubuntu` Docker Container.
- choice 2: working on `Ubuntu` with `root` privilege. - choice 2: working on `Ubuntu` with `root` privilege.
To avoid the trouble of environment setup, [running in Docker container](#running-in-docker-container) is highly recommended. Otherwise, if you work on `Ubuntu` with `root` privilege, you can skip the next step. To avoid the trouble of environment setup, running in Docker container is highly recommended. Otherwise, if you work on `Ubuntu` with `root` privilege, you can still complete the installation.
### Choice 1: Running in Docker Container (Recommand) ### Choice 1: Running in Docker Container (Recommand)
Docker is an open-source tool to build, ship, and run distributed applications in an isolated environment. A Docker image for this project has been provided in [hub.docker.com](https://hub.docker.com) with all the dependencies installed. This Docker image requires the support of NVIDIA GPU, so please make sure its availability and the [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) has been installed. Docker is an open-source tool to build, ship, and run distributed applications in an isolated environment. A Docker image for this project has been provided in [hub.docker.com](https://hub.docker.com) with all the dependencies installed. This Docker image requires the support of NVIDIA GPU, so please make sure its availability and the [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) has been installed.
@ -135,7 +140,12 @@ git clone https://github.com/PaddlePaddle/PaddleSpeech.git
```bash ```bash
sudo nvidia-docker run --net=host --ipc=host --rm -it -v $(pwd)/PaddleSpeech:/PaddleSpeech registry.baidubce.com/paddlepaddle/paddle:2.2.0-gpu-cuda10.2-cudnn7 /bin/bash sudo nvidia-docker run --net=host --ipc=host --rm -it -v $(pwd)/PaddleSpeech:/PaddleSpeech registry.baidubce.com/paddlepaddle/paddle:2.2.0-gpu-cuda10.2-cudnn7 /bin/bash
``` ```
- Enter PaddleSpeech directory.
```bash
cd /PaddleSpeech
```
Now you can execute training, inference and hyper-parameters tuning in Docker container. Now you can execute training, inference and hyper-parameters tuning in Docker container.
### Choice 2: Running in Ubuntu with Root Privilege ### Choice 2: Running in Ubuntu with Root Privilege
- Install `build-essential` by apt - Install `build-essential` by apt
```bash ```bash
@ -144,10 +154,8 @@ sudo apt install build-essential
- Clone this repository - Clone this repository
```bash ```bash
git clone https://github.com/PaddlePaddle/PaddleSpeech.git git clone https://github.com/PaddlePaddle/PaddleSpeech.git
``` # Enter the PaddleSpeech dir
- Install paddle 2.2.0: cd PaddleSpeech
```bash
python3 -m pip install paddlepaddle-gpu==2.2.0
``` ```
### Install the Conda ### Install the Conda
```bash ```bash
@ -165,12 +173,12 @@ conda activate tools/venv
conda install -y -c conda-forge sox libsndfile swig bzip2 libflac bc conda install -y -c conda-forge sox libsndfile swig bzip2 libflac bc
``` ```
### Install PaddlePaddle ### Install PaddlePaddle
For example, for CUDA 10.2, CuDNN7.5 install paddle 2.2.0: Make sure you have GPU and the paddlepaddle version is right. For example, for CUDA 10.2, CuDNN7.5 install paddle 2.2.0:
```bash ```bash
python3 -m pip install paddlepaddle-gpu==2.2.0 python3 -m pip install paddlepaddle-gpu==2.2.0
``` ```
### Get the Function for Developing PaddleSpeech ### Install PaddleSpeech in Developing Mode
```bash ```bash
pip install -e .[develop] pip install -e .[develop]
``` ```
@ -182,8 +190,3 @@ bash extras/install_kaldi.sh
popd popd
``` ```
## Setup for Other Platform
- Make sure these libraries or tools in [dependencies](./dependencies.md) installed. More information please see: `setup.py `and `tools/Makefile`.
- The version of `swig` should >= 3.0
- we will simplify the install process in the future.

Loading…
Cancel
Save