From 675a1ee2e560262fe565a8ddeed6128e032922e6 Mon Sep 17 00:00:00 2001 From: Giuseppe Scriva <67858959+gscriva@users.noreply.github.com> Date: Thu, 30 Sep 2021 12:47:19 +0200 Subject: [PATCH] Enanche trainer debug #177 (#179) *modifiy `configs/trainer/debug.yaml` to enable some debug options *remove unused `if config.get("debug"):` in `extras` *update the documentation --- README.md | 5 ++++- configs/trainer/debug.yaml | 8 ++++---- src/utils/utils.py | 4 ---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1fbd371..5ef7cd9 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,7 @@ python run.py +trainer.max_time="00:12:00:00" ```yaml # run 1 train, val and test loop, using only 1 batch -python run.py trainer.fast_dev_run=true +python run.py +trainer.fast_dev_run=true # print full weight summary of all PyTorch modules python run.py trainer.weights_summary="full" @@ -294,6 +294,9 @@ python run.py +trainer.profiler="simple" # raise exception, if any of the parameters or the loss are NaN or +/-inf python run.py +trainer.terminate_on_nan=true +# Quick debug with all the previous options enabled +python run.py trainer=debug + # try overfitting to 1 batch python run.py +trainer.overfit_batches=1 trainer.max_epochs=20 diff --git a/configs/trainer/debug.yaml b/configs/trainer/debug.yaml index 09919d7..e729b6e 100644 --- a/configs/trainer/debug.yaml +++ b/configs/trainer/debug.yaml @@ -8,15 +8,15 @@ max_epochs: 2 # prints progress_bar_refresh_rate: null -weights_summary: null -profiler: null +weights_summary: "full" +profiler: "simple" # debugs -fast_dev_run: False +fast_dev_run: true num_sanity_val_steps: 2 overfit_batches: 0 limit_train_batches: 1.0 limit_val_batches: 1.0 limit_test_batches: 1.0 track_grad_norm: -1 -terminate_on_nan: False +terminate_on_nan: true diff --git a/src/utils/utils.py b/src/utils/utils.py index 4c019f5..79276f7 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -46,10 +46,6 @@ def extras(config: DictConfig) -> None: log.info("Disabling python warnings! ") warnings.filterwarnings("ignore") - # if - if config.get("debug"): - log.info("Running in debug mode! ") - # if if config.get("name"): log.info("Running in experiment mode! Name: {}".format(config.name))