From 0aaf93a1b8332fab141d9b0dba13e574d7c10dfb Mon Sep 17 00:00:00 2001 From: Xinghai Sun Date: Sat, 7 Oct 2017 06:40:03 -0700 Subject: [PATCH] Set process daemon property and reset default value of num_proc_data arguments. --- deep_speech_2/data_utils/utility.py | 2 ++ deep_speech_2/examples/aishell/run_train.sh | 2 +- deep_speech_2/examples/librispeech/run_train.sh | 2 +- deep_speech_2/test.py | 2 +- deep_speech_2/train.py | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deep_speech_2/data_utils/utility.py b/deep_speech_2/data_utils/utility.py index 40e212c8..123348cb 100644 --- a/deep_speech_2/data_utils/utility.py +++ b/deep_speech_2/data_utils/utility.py @@ -133,6 +133,7 @@ def xmap_readers_mp(mapper, reader, process_num, buffer_size, order=False): # start a read worker in a process target = order_read_worker if order else read_worker p = Process(target=target, args=(reader, in_queue)) + p.daemon = True p.start() # start handle_workers with multiple processes @@ -143,6 +144,7 @@ def xmap_readers_mp(mapper, reader, process_num, buffer_size, order=False): Process(target=target, args=args) for _ in xrange(process_num) ] for w in workers: + w.daemon = True w.start() # get results diff --git a/deep_speech_2/examples/aishell/run_train.sh b/deep_speech_2/examples/aishell/run_train.sh index 8e61ec3c..afb7d2ef 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=12 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=1024 \ diff --git a/deep_speech_2/examples/librispeech/run_train.sh b/deep_speech_2/examples/librispeech/run_train.sh index 69251fe0..073619c2 100644 --- a/deep_speech_2/examples/librispeech/run_train.sh +++ b/deep_speech_2/examples/librispeech/run_train.sh @@ -9,7 +9,7 @@ python -u train.py \ --batch_size=512 \ --trainer_count=8 \ --num_passes=50 \ ---num_proc_data=12 \ +--num_proc_data=8 \ --num_conv_layers=2 \ --num_rnn_layers=3 \ --rnn_layer_size=2048 \ diff --git a/deep_speech_2/test.py b/deep_speech_2/test.py index 40f0795a..51c725c5 100644 --- a/deep_speech_2/test.py +++ b/deep_speech_2/test.py @@ -18,7 +18,7 @@ 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, 12, "# of CPUs for data preprocessing.") +add_arg('num_proc_data', int, 4, "# 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/train.py b/deep_speech_2/train.py index 44b2ccbc..017cc73f 100644 --- a/deep_speech_2/train.py +++ b/deep_speech_2/train.py @@ -16,7 +16,7 @@ add_arg = functools.partial(add_arguments, argparser=parser) 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, 12, "# of CPUs for data preprocessing.") +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.") -- GitLab