README.md 1.6 KB
Newer Older
1 2
# Deep Speech 2 on PaddlePaddle

3
## Installation
4

5
Please replace `$PADDLE_INSTALL_DIR` with your own paddle installation directory.
6 7 8 9 10 11 12 13

```
pip install -r requirements.txt
export LD_LIBRARY_PATH=$PADDLE_INSTALL_DIR/Paddle/third_party/install/warpctc/lib:$LD_LIBRARY_PATH
```

For some machines, we also need to install libsndfile1. Details to be added.

14 15 16
## Usage

### Preparing Data
17

18
```
X
Xinghai Sun 已提交
19 20
cd datasets
sh run_all.sh
21
cd ..
22
```
23

X
Xinghai Sun 已提交
24
`sh run_all.sh` prepares all ASR datasets (currently, only LibriSpeech available). After running, we have several summarization manifest files in json-format.
25

X
Xinghai Sun 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
A manifest file summarizes a speech data set, with each line containing the meta data (i.e. audio filepath, transcript text, audio duration) of each audio file within the data set, in json format. Manifest file serves as an interface informing our system of  where and what to read the speech samples.


More help for arguments:

```
python datasets/librispeech/librispeech.py --help
```

### Preparing for Training

```
python compute_mean_std.py
```

`python compute_mean_std.py` computes mean and stdandard deviation for audio features, and save them to a file with a default name `./mean_std.npz`. This file will be used in both training and inferencing.
42

43 44 45
More help for arguments:

```
X
Xinghai Sun 已提交
46
python compute_mean_std.py --help
47 48
```

X
Xinghai Sun 已提交
49
### Training
50 51 52 53

For GPU Training:

```
X
Xinghai Sun 已提交
54
CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py --trainer_count 4
55 56 57 58 59
```

For CPU Training:

```
X
Xinghai Sun 已提交
60
python train.py --trainer_count 8 --use_gpu False
61 62 63 64 65 66 67 68 69 70 71
```

More help for arguments:

```
python train.py --help
```

### Inferencing

```
X
Xinghai Sun 已提交
72
CUDA_VISIBLE_DEVICES=0 python infer.py
73 74 75 76 77 78 79
```

More help for arguments:

```
python infer.py --help
```