diff --git a/deepspeech/training/trainer.py b/deepspeech/training/trainer.py index bdb68310a08ccdbabe5487d4ba9f73d8f259f5d6..b31ddcad6584aefc669d5fd361e76a7f993f97ac 100644 --- a/deepspeech/training/trainer.py +++ b/deepspeech/training/trainer.py @@ -185,7 +185,8 @@ class Trainer(): batch_sampler.set_epoch(self.epoch) def after_train_batch(self): - profiler.add_profiler_step(self.args.profiler_options) + if self.args.profiler_options: + profiler.add_profiler_step(self.args.profiler_options) def train(self): """The training process control by epoch.""" diff --git a/deepspeech/utils/profiler.py b/deepspeech/utils/profiler.py index 5b8389be8ab261b8ad94c2c291af4b725475891e..357840a629d482f9e26bef153654c4cb04812f00 100644 --- a/deepspeech/utils/profiler.py +++ b/deepspeech/utils/profiler.py @@ -61,6 +61,9 @@ class ProfilerOptions(object): self._parse_from_string(options_str) def _parse_from_string(self, options_str): + if not options_str: + return + for kv in options_str.replace(' ', '').split(';'): key, value = kv.split('=') if key == 'batch_range': diff --git a/examples/tiny/s0/conf/deepspeech2.yaml b/examples/tiny/s0/conf/deepspeech2.yaml index 64598b4be5b58dd26995c168d618ca2d9ed2aff3..408996557e79a058cba4fec8eea107ffdea4eb87 100644 --- a/examples/tiny/s0/conf/deepspeech2.yaml +++ b/examples/tiny/s0/conf/deepspeech2.yaml @@ -48,7 +48,7 @@ training: n_epoch: 10 accum_grad: 1 lr: 1e-5 - lr_decay: 1.0 + lr_decay: 0.8 weight_decay: 1e-06 global_grad_clip: 5.0 log_interval: 1 diff --git a/examples/tiny/s0/local/train.sh b/examples/tiny/s0/local/train.sh index a657ce345993cb3df844fe461a5fa1357218b5fd..f96508b4f594acd360c8a1e9073c7462f3d4a97e 100755 --- a/examples/tiny/s0/local/train.sh +++ b/examples/tiny/s0/local/train.sh @@ -38,7 +38,7 @@ python3 -u ${BIN_DIR}/train.py \ --config ${config_path} \ --output exp/${ckpt_name} \ --model_type ${model_type} \ ---profiler_options ${profiler_options} \ +--profiler_options "${profiler_options}" \ --seed ${seed} if [ ${seed} != 0 ]; then