From d82794c067f1c8be67272e4e0d6dfa2e42e9fe29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20=C5=BBelasko?= Date: Thu, 12 Nov 2020 21:52:06 -0500 Subject: [PATCH 1/2] Update Lhotse's augmentation API usage --- egs/librispeech/asr/simple_v1/prepare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egs/librispeech/asr/simple_v1/prepare.py b/egs/librispeech/asr/simple_v1/prepare.py index d0971db6..7b91d3b2 100755 --- a/egs/librispeech/asr/simple_v1/prepare.py +++ b/egs/librispeech/asr/simple_v1/prepare.py @@ -44,7 +44,7 @@ supervisions=manifests['supervisions']).compute_and_store_features( extractor=Fbank(), storage=storage, - augmenter=augmenter if 'train' in partition else None, + augment_fn=augmenter if 'train' in partition else None, executor=ex) librispeech_manifests[partition]['cuts'] = cut_set cut_set.to_json(output_dir + f'/cuts_{partition}.json.gz') From b00a78785680b42a3dff5dea9bc2b88a315a54e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20=C5=BBelasko?= Date: Thu, 12 Nov 2020 21:54:59 -0500 Subject: [PATCH 2/2] update executor --- egs/librispeech/asr/simple_v1/prepare.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/asr/simple_v1/prepare.py b/egs/librispeech/asr/simple_v1/prepare.py index 7b91d3b2..0f688bcd 100755 --- a/egs/librispeech/asr/simple_v1/prepare.py +++ b/egs/librispeech/asr/simple_v1/prepare.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import multiprocessing import os from concurrent.futures import ProcessPoolExecutor from pathlib import Path @@ -37,8 +38,8 @@ num_jobs = 1 for partition, manifests in librispeech_manifests.items(): print(partition) - with LilcomFilesWriter(f'{output_dir}/feats_{partition}' - ) as storage, ProcessPoolExecutor(num_jobs) as ex: + with LilcomFilesWriter(f'{output_dir}/feats_{partition}') as storage, \ + ProcessPoolExecutor(num_jobs, mp_context=multiprocessing.get_context("spawn")) as ex: cut_set = CutSet.from_manifests( recordings=manifests['recordings'], supervisions=manifests['supervisions']).compute_and_store_features(