From 58859d580d6e47f2a6311d8f318a87ffb6cb052c Mon Sep 17 00:00:00 2001 From: Di Wu <1176705630@qq.com> Date: Mon, 9 Oct 2023 17:33:52 +0800 Subject: [PATCH] [wekws] fix log (only one process print model) (#150) Co-authored-by: di.wu --- wekws/bin/train.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wekws/bin/train.py b/wekws/bin/train.py index c88ea1f..025ebf9 100644 --- a/wekws/bin/train.py +++ b/wekws/bin/train.py @@ -141,15 +141,14 @@ def main(): configs['model']['cmvn'] = {} configs['model']['cmvn']['norm_var'] = args.norm_var configs['model']['cmvn']['cmvn_file'] = args.cmvn_file + # Init asr model from configs + model = init_model(configs['model']) if rank == 0: saved_config_path = os.path.join(args.model_dir, 'config.yaml') with open(saved_config_path, 'w') as fout: data = yaml.dump(configs) fout.write(data) - - # Init asr model from configs - model = init_model(configs['model']) - print(model) + print(model) num_params = count_parameters(model) print('the number of model params: {}'.format(num_params))