From de9b2a9cd1eb7d1ad98d2bd170f453f485ce063f Mon Sep 17 00:00:00 2001 From: Mingshuang Luo <37799481+luomingshuang@users.noreply.github.com> Date: Wed, 29 Sep 2021 16:54:21 +0800 Subject: [PATCH] Update train.py --- egs/yesno/ASR/tdnn/train.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/egs/yesno/ASR/tdnn/train.py b/egs/yesno/ASR/tdnn/train.py index e476e8beb..f2463428b 100755 --- a/egs/yesno/ASR/tdnn/train.py +++ b/egs/yesno/ASR/tdnn/train.py @@ -4,11 +4,10 @@ import argparse import logging from pathlib import Path from shutil import copyfile -from typing import Optional, Tuple, List +from typing import Optional, Tuple import k2 import torch -import torch.distributed as dist import torch.multiprocessing as mp import torch.nn as nn import torch.optim as optim @@ -414,8 +413,8 @@ def train_one_epoch( if batch_idx % params.log_interval == 0: logging.info( f"Epoch {params.cur_epoch}, batch {batch_idx}, loss[{loss_info}]" - f"tot_loss[{tot_loss}], batch size: {batch_size}" - ) + f"tot_loss[{tot_loss}], batch size: {batch_size}") + if batch_idx % 10 == 0: if tb_writer is not None: