From 65212ee0041db43c826c5331c907730ba7c87cd4 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Tue, 28 Dec 2021 10:31:20 +0800 Subject: [PATCH] Remove grad clipping as there are no RNNs in the network. --- egs/librispeech/ASR/transducer_stateless/train.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/egs/librispeech/ASR/transducer_stateless/train.py b/egs/librispeech/ASR/transducer_stateless/train.py index 694ebf1d5..4a8da755e 100755 --- a/egs/librispeech/ASR/transducer_stateless/train.py +++ b/egs/librispeech/ASR/transducer_stateless/train.py @@ -52,7 +52,6 @@ from lhotse.utils import fix_random_seed from model import Transducer from torch import Tensor from torch.nn.parallel import DistributedDataParallel as DDP -from torch.nn.utils import clip_grad_norm_ from torch.utils.tensorboard import SummaryWriter from transformer import Noam @@ -485,7 +484,6 @@ def train_one_epoch( optimizer.zero_grad() loss.backward() - clip_grad_norm_(model.parameters(), 5.0, 2.0) optimizer.step() if batch_idx % params.log_interval == 0: @@ -699,7 +697,6 @@ def scan_pessimistic_batches_for_oom( is_training=True, ) loss.backward() - clip_grad_norm_(model.parameters(), 5.0, 2.0) optimizer.step() except RuntimeError as e: if "CUDA out of memory" in str(e):