From 0541f880439e5064d8fb7401189af05552cf1f7b Mon Sep 17 00:00:00 2001 From: SimonKamuk <43374850+SimonKamuk@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:50:21 +0100 Subject: [PATCH] add detect_anomaly in test_training.py (#124) --- CHANGELOG.md | 1 + tests/test_training.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a99c9d37..2a35f417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 in time and space (on cropped ~100x100 grid-point domain) [\#110](https://github.com/mllam/neural-lam/pull/110), @leifdenby + - add detect_anomaly=True to pl.Trainer in test_training.py [\#124](https://github.com/mllam/neural-lam/pull/124), @SimonKamuk ## [v0.3.0](https://github.com/mllam/neural-lam/releases/tag/v0.3.0) diff --git a/tests/test_training.py b/tests/test_training.py index 1ed1847d..ec28cb94 100644 --- a/tests/test_training.py +++ b/tests/test_training.py @@ -44,6 +44,9 @@ def test_training(datastore_name): # because it expects to aggregate over multiple devices devices=2, log_every_n_steps=1, + # use `detect_anomaly` to ensure that we don't have NaNs popping up + # during training + detect_anomaly=True, ) graph_name = "1level"