mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Dont print out full non-finite tensor
This commit is contained in:
parent
e0c1dc66da
commit
ad2d3c2b36
@ -66,7 +66,7 @@ def register_inf_check_hooks(model: nn.Module) -> None:
|
|||||||
continue
|
continue
|
||||||
if not torch.isfinite(o.to(torch.float32).sum()):
|
if not torch.isfinite(o.to(torch.float32).sum()):
|
||||||
logging.warning(
|
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)
|
module.register_forward_hook(forward_hook)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user