From 51992c7ba62fd870790dced3cc6292c75a588df2 Mon Sep 17 00:00:00 2001 From: Xinghai Sun Date: Wed, 11 Oct 2017 22:36:20 +0800 Subject: [PATCH] Reset default value of batch_size, nun_proc_data and fix an invalid url for DS2. --- deep_speech_2/examples/aishell/run_test.sh | 2 +- deep_speech_2/examples/aishell/run_test_golden.sh | 2 +- deep_speech_2/examples/aishell/run_train.sh | 2 +- deep_speech_2/examples/librispeech/run_test.sh | 2 +- deep_speech_2/examples/librispeech/run_test_golden.sh | 2 +- deep_speech_2/examples/librispeech/run_train.sh | 4 ++-- deep_speech_2/examples/librispeech/run_tune.sh | 2 +- deep_speech_2/examples/tiny/run_test.sh | 2 +- deep_speech_2/examples/tiny/run_test_golden.sh | 2 +- deep_speech_2/infer.py | 2 +- deep_speech_2/models/librispeech/download_model.sh | 2 +- deep_speech_2/test.py | 4 ++-- deep_speech_2/tools/tune.py | 5 +++-- deep_speech_2/train.py | 2 +- 14 files changed, 18 insertions(+), 17 deletions(-) diff --git a/deep_speech_2/examples/aishell/run_test.sh b/deep_speech_2/examples/aishell/run_test.sh index 266c736766..feec95cb45 100644 --- a/deep_speech_2/examples/aishell/run_test.sh +++ b/deep_speech_2/examples/aishell/run_test.sh @@ -18,7 +18,7 @@ python -u test.py \ --trainer_count=8 \ --beam_size=300 \ --num_proc_bsearch=8 \ ---num_proc_data=4 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=1024 \ diff --git a/deep_speech_2/examples/aishell/run_test_golden.sh b/deep_speech_2/examples/aishell/run_test_golden.sh index 50e7fe2c62..387d54f395 100644 --- a/deep_speech_2/examples/aishell/run_test_golden.sh +++ b/deep_speech_2/examples/aishell/run_test_golden.sh @@ -27,7 +27,7 @@ python -u test.py \ --trainer_count=8 \ --beam_size=300 \ --num_proc_bsearch=8 \ ---num_proc_data=4 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=1024 \ diff --git a/deep_speech_2/examples/aishell/run_train.sh b/deep_speech_2/examples/aishell/run_train.sh index afb7d2efb2..077fabcd8d 100644 --- a/deep_speech_2/examples/aishell/run_train.sh +++ b/deep_speech_2/examples/aishell/run_train.sh @@ -9,7 +9,7 @@ python -u train.py \ --batch_size=64 \ --trainer_count=8 \ --num_passes=50 \ ---num_proc_data=8 \ +--num_proc_data=16 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=1024 \ diff --git a/deep_speech_2/examples/librispeech/run_test.sh b/deep_speech_2/examples/librispeech/run_test.sh index d79a225639..b67d25ed5c 100644 --- a/deep_speech_2/examples/librispeech/run_test.sh +++ b/deep_speech_2/examples/librispeech/run_test.sh @@ -18,7 +18,7 @@ python -u test.py \ --trainer_count=8 \ --beam_size=500 \ --num_proc_bsearch=8 \ ---num_proc_data=4 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=2048 \ diff --git a/deep_speech_2/examples/librispeech/run_test_golden.sh b/deep_speech_2/examples/librispeech/run_test_golden.sh index 011cdd2ab3..3e7e3b4c5c 100644 --- a/deep_speech_2/examples/librispeech/run_test_golden.sh +++ b/deep_speech_2/examples/librispeech/run_test_golden.sh @@ -27,7 +27,7 @@ python -u test.py \ --trainer_count=8 \ --beam_size=500 \ --num_proc_bsearch=8 \ ---num_proc_data=4 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=2048 \ diff --git a/deep_speech_2/examples/librispeech/run_train.sh b/deep_speech_2/examples/librispeech/run_train.sh index 073619c2ab..ea6a608237 100644 --- a/deep_speech_2/examples/librispeech/run_train.sh +++ b/deep_speech_2/examples/librispeech/run_train.sh @@ -6,10 +6,10 @@ cd ../.. > /dev/null # if you wish to resume from an exists model, uncomment --init_model_path CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \ python -u train.py \ ---batch_size=512 \ +--batch_size=160 \ --trainer_count=8 \ --num_passes=50 \ ---num_proc_data=8 \ +--num_proc_data=16 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=2048 \ diff --git a/deep_speech_2/examples/librispeech/run_tune.sh b/deep_speech_2/examples/librispeech/run_tune.sh index 78b2972d0e..c3695d1cb2 100644 --- a/deep_speech_2/examples/librispeech/run_tune.sh +++ b/deep_speech_2/examples/librispeech/run_tune.sh @@ -6,7 +6,7 @@ cd ../.. > /dev/null CUDA_VISIBLE_DEVICES=0,1,2,3 \ python -u tools/tune.py \ --num_batches=-1 \ ---batch_size=256 \ +--batch_size=128 \ --trainer_count=8 \ --beam_size=500 \ --num_proc_bsearch=12 \ diff --git a/deep_speech_2/examples/tiny/run_test.sh b/deep_speech_2/examples/tiny/run_test.sh index 690dfe739d..27a3fc6f52 100644 --- a/deep_speech_2/examples/tiny/run_test.sh +++ b/deep_speech_2/examples/tiny/run_test.sh @@ -18,7 +18,7 @@ python -u test.py \ --trainer_count=8 \ --beam_size=500 \ --num_proc_bsearch=8 \ ---num_proc_data=4 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=2048 \ diff --git a/deep_speech_2/examples/tiny/run_test_golden.sh b/deep_speech_2/examples/tiny/run_test_golden.sh index 16adf29888..8c00895d55 100644 --- a/deep_speech_2/examples/tiny/run_test_golden.sh +++ b/deep_speech_2/examples/tiny/run_test_golden.sh @@ -27,7 +27,7 @@ python -u test.py \ --trainer_count=8 \ --beam_size=500 \ --num_proc_bsearch=8 \ ---num_proc_data=4 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=2048 \ diff --git a/deep_speech_2/infer.py b/deep_speech_2/infer.py index 5d9439cf2b..a30d48d6de 100644 --- a/deep_speech_2/infer.py +++ b/deep_speech_2/infer.py @@ -17,7 +17,7 @@ add_arg('num_samples', int, 10, "# of samples to infer.") add_arg('trainer_count', int, 8, "# of Trainers (CPUs or GPUs).") add_arg('beam_size', int, 500, "Beam search width.") -add_arg('num_proc_bsearch', int, 12, "# of CPUs for beam search.") +add_arg('num_proc_bsearch', int, 8, "# of CPUs for beam search.") add_arg('num_conv_layers', int, 2, "# of convolution layers.") add_arg('num_rnn_layers', int, 3, "# of recurrent layers.") add_arg('rnn_layer_size', int, 2048, "# of recurrent cells per layer.") diff --git a/deep_speech_2/models/librispeech/download_model.sh b/deep_speech_2/models/librispeech/download_model.sh index 0048ff166f..9c0ec2783b 100644 --- a/deep_speech_2/models/librispeech/download_model.sh +++ b/deep_speech_2/models/librispeech/download_model.sh @@ -2,7 +2,7 @@ . ../../utils/utility.sh -URL='http://cloud.dlnel.org/filepub/?uuid=8e3cf742-2ff3-41ce-a49d-f6158cc06a23' +URL='http://cloud.dlnel.org/filepub/?uuid=6020a634-5399-4423-b021-c5ed32680fff' MD5=2ef08f8b608a7c555592161fc14d81a6 TARGET=./librispeech_model.tar.gz diff --git a/deep_speech_2/test.py b/deep_speech_2/test.py index 1fe0fbb7c2..94c09150ca 100644 --- a/deep_speech_2/test.py +++ b/deep_speech_2/test.py @@ -17,8 +17,8 @@ add_arg('batch_size', int, 128, "Minibatch size.") add_arg('trainer_count', int, 8, "# of Trainers (CPUs or GPUs).") add_arg('beam_size', int, 500, "Beam search width.") -add_arg('num_proc_bsearch', int, 12, "# of CPUs for beam search.") -add_arg('num_proc_data', int, 4, "# of CPUs for data preprocessing.") +add_arg('num_proc_bsearch', int, 8, "# of CPUs for beam search.") +add_arg('num_proc_data', int, 8, "# of CPUs for data preprocessing.") add_arg('num_conv_layers', int, 2, "# of convolution layers.") add_arg('num_rnn_layers', int, 3, "# of recurrent layers.") add_arg('rnn_layer_size', int, 2048, "# of recurrent cells per layer.") diff --git a/deep_speech_2/tools/tune.py b/deep_speech_2/tools/tune.py index 83c71e7dbe..233ec4ab84 100644 --- a/deep_speech_2/tools/tune.py +++ b/deep_speech_2/tools/tune.py @@ -27,7 +27,8 @@ add_arg('batch_size', int, 256, "# of samples per batch.") add_arg('trainer_count', int, 8, "# of Trainers (CPUs or GPUs).") add_arg('beam_size', int, 500, "Beam search width.") -add_arg('num_proc_bsearch', int, 12, "# of CPUs for beam search.") +add_arg('num_proc_bsearch', int, 8, "# of CPUs for beam search.") +add_arg('num_proc_data', int, 8, "# of CPUs for data preprocessing.") add_arg('num_conv_layers', int, 2, "# of convolution layers.") add_arg('num_rnn_layers', int, 3, "# of recurrent layers.") add_arg('rnn_layer_size', int, 2048, "# of recurrent cells per layer.") @@ -86,7 +87,7 @@ def tune(): mean_std_filepath=args.mean_std_path, augmentation_config='{}', specgram_type=args.specgram_type, - num_threads=1) + num_threads=args.num_proc_data) audio_data = paddle.layer.data( name="audio_spectrogram", diff --git a/deep_speech_2/train.py b/deep_speech_2/train.py index a9c7157692..16415713f6 100644 --- a/deep_speech_2/train.py +++ b/deep_speech_2/train.py @@ -16,7 +16,7 @@ add_arg('batch_size', int, 256, "Minibatch size.") add_arg('trainer_count', int, 8, "# of Trainers (CPUs or GPUs).") add_arg('num_passes', int, 200, "# of training epochs.") -add_arg('num_proc_data', int, 8, "# of CPUs for data preprocessing.") +add_arg('num_proc_data', int, 16, "# of CPUs for data preprocessing.") add_arg('num_conv_layers', int, 2, "# of convolution layers.") add_arg('num_rnn_layers', int, 3, "# of recurrent layers.") add_arg('rnn_layer_size', int, 2048, "# of recurrent cells per layer.")