Skip to content

Commit

Permalink
Merge pull request #1766 from Jackwaterveg/fix
Browse files Browse the repository at this point in the history
[ASR] ds2: add log_interval and  fix lr problem when resume training
  • Loading branch information
zh794390558 authored Apr 24, 2022
2 parents beee313 + 5912ba5 commit 312fc4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions paddlespeech/s2t/training/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ def do_train(self):
float) else f"{v}"
msg += ","
msg = msg[:-1] # remove the last ","
logger.info(msg)
if (batch_index + 1) % self.config.log_interval == 0:
logger.info(msg)
data_start_time = time.time()
except Exception as e:
logger.error(e)
Expand All @@ -316,10 +317,10 @@ def do_train(self):
self.visualizer.add_scalar(
tag='eval/lr', value=self.lr_scheduler(), step=self.epoch)

# after epoch
self.save(tag=self.epoch, infos={'val_loss': cv_loss})
# step lr every epoch
self.lr_scheduler.step()
# after epoch
self.save(tag=self.epoch, infos={'val_loss': cv_loss})
self.new_epoch()

def run(self):
Expand Down

0 comments on commit 312fc4e

Please sign in to comment.