README.md 2.7 KB
Newer Older
1
# Run DS2 on PaddleCloud
2

W
wanghaoshuang 已提交
3 4
>Note:
>Make sure [PaddleCloud client](https://github.com/PaddlePaddle/cloud/blob/develop/doc/usage_cn.md#%E4%B8%8B%E8%BD%BD%E5%B9%B6%E9%85%8D%E7%BD%AEpaddlecloud) has be installed and current directory is `models/deep_speech_2/cloud/`
5

W
wanghaoshuang 已提交
6
## Step-1  Configure data set
7

W
wanghaoshuang 已提交
8
Configure your input data and output path in pcloud_submit.sh:
9

W
wanghaoshuang 已提交
10
-  `TRAIN_MANIFEST`: Absolute path of train data manifest file in local file system.This file has format as bellow:
11 12 13 14 15 16 17 18

```
{"audio_filepath": "/home/disk1/LibriSpeech/dev-clean/1272/128104/1272-128104-0000.flac", "duration": 5.855, "text
": "mister quilter is the ..."}
{"audio_filepath": "/home/disk1/LibriSpeech/dev-clean/1272/128104/1272-128104-0001.flac", "duration": 4.815, "text
": "nor is mister ..."}
```

W
wanghaoshuang 已提交
19
- `TEST_MANIFEST`: Absolute path of train data manifest file in local filesystem. This file has format like `TRAIN_MANIFEST`.
20
- `VOCAB_FILE`:  Absolute path of vocabulary file in local filesytem.
W
wanghaoshuang 已提交
21
- `MEAN_STD_FILE`: Absolute path of normalizer's statistic file in local filesytem.
22 23 24
- `CLOUD_DATA_DIR:`  Absolute path in PaddleCloud filesystem. We will upload local train data to this directory.
- `CLOUD_MODEL_DIR`: Absolute path in PaddleCloud filesystem. PaddleCloud trainer will save model to this directory.

W
wanghaoshuang 已提交
25
>Note: Upload will be skipped if target file has existed in `CLOUD_DATA_DIR`.
26

W
wanghaoshuang 已提交
27
## Step-2  Configure computation resource
28

W
wanghaoshuang 已提交
29
Configure computation resource in pcloud_submit.sh:
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

```
# Configure computation resource and submit job to PaddleCloud
 paddlecloud submit \
 -image wanghaoshuang/pcloud_ds2:latest \
 -jobname ${JOB_NAME} \
 -cpu 4 \
 -gpu 4 \
 -memory 10Gi \
 -parallelism 1 \
 -pscpu 1 \
 -pservers 1 \
 -psmemory 10Gi \
 -passes 1 \
 -entry "sh pcloud_train.sh ${CLOUD_DATA_DIR} ${CLOUD_MODEL_DIR}" \
 ${DS2_PATH}
```
W
wanghaoshuang 已提交
47
For more information, please refer to [PaddleCloud](https://github.com/PaddlePaddle/cloud/blob/develop/doc/usage_cn.md#提交任务)
48

W
wanghaoshuang 已提交
49 50
## Step-3  Configure algorithm options
Configure algorithm options in pcloud_train.sh:
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
```
python train.py \
--use_gpu=1 \
--trainer_count=4 \
--batch_size=256 \
--mean_std_filepath=$MEAN_STD_FILE \
--train_manifest_path='./local.train.manifest' \
--dev_manifest_path='./local.test.manifest' \
--vocab_filepath=$VOCAB_PATH \
--output_model_dir=${MODEL_PATH}
```
You can get more information about algorithm options by follow command:
```
cd ..
python train.py --help
```

W
wanghaoshuang 已提交
68
## Step-4  Submit job
69 70 71 72 73
```
$ sh pcloud_submit.sh
```


W
wanghaoshuang 已提交
74
## Step-5 Get logs
75 76 77
```
$ paddlecloud logs -n 10000 deepspeech20170727130129
```
78 79 80 81
For more information, please refer to [PaddleCloud client](https://github.com/PaddlePaddle/cloud/blob/develop/doc/usage_cn.md#下载并配置paddlecloud) or get help by follow command:
```
paddlecloud --help
```