From ad2d3c2b36d96193b6eda14893464c5cdc245e3e Mon Sep 17 00:00:00 2001 From: Daniel Povey Date: Sat, 22 Oct 2022 23:03:19 +0800 Subject: [PATCH] Dont print out full non-finite tensor --- icefall/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icefall/hooks.py b/icefall/hooks.py index eef2bc8b1..fbcf5e148 100644 --- a/icefall/hooks.py +++ b/icefall/hooks.py @@ -66,7 +66,7 @@ def register_inf_check_hooks(model: nn.Module) -> None: continue if not torch.isfinite(o.to(torch.float32).sum()): logging.warning( - f"The sum of {_name}.grad[{i}] is not finite: {o}" + f"The sum of {_name}.grad[{i}] is not finite" ) module.register_forward_hook(forward_hook)