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
This commit is contained in:
Giuseppe Scriva authored and GitHub committed 2021-09-30 12:47:19 +02:00
1 parent 86f30fb320
commit 675a1ee2e5
3 files changed
+8 -9

No files matched your search

+4 -1
View File
@@ -283,7 +283,7 @@ python run.py +trainer.max_time="00:12:00:00"
```yaml ```yaml
# run 1 train, val and test loop, using only 1 batch # 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 # print full weight summary of all PyTorch modules
python run.py trainer.weights_summary="full" 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 # raise exception, if any of the parameters or the loss are NaN or +/-inf
python run.py +trainer.terminate_on_nan=true 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 # try overfitting to 1 batch
python run.py +trainer.overfit_batches=1 trainer.max_epochs=20 python run.py +trainer.overfit_batches=1 trainer.max_epochs=20
+4 -4
View File
@@ -8,15 +8,15 @@ max_epochs: 2
# prints # prints
progress_bar_refresh_rate: null progress_bar_refresh_rate: null
weights_summary: null weights_summary: "full"
profiler: null profiler: "simple"
# debugs # debugs
fast_dev_run: False fast_dev_run: true
num_sanity_val_steps: 2 num_sanity_val_steps: 2
overfit_batches: 0 overfit_batches: 0
limit_train_batches: 1.0 limit_train_batches: 1.0
limit_val_batches: 1.0 limit_val_batches: 1.0
limit_test_batches: 1.0 limit_test_batches: 1.0
track_grad_norm: -1 track_grad_norm: -1
terminate_on_nan: False terminate_on_nan: true
-4
View File
@@ -46,10 +46,6 @@ def extras(config: DictConfig) -> None:
log.info("Disabling python warnings! <config.ignore_warnings=True>") log.info("Disabling python warnings! <config.ignore_warnings=True>")
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
# if <config.debug=True>
if config.get("debug"):
log.info("Running in debug mode! <config.debug=True>")
# if <config.name=...> # if <config.name=...>
if config.get("name"): if config.get("name"):
log.info("Running in experiment mode! Name: {}".format(config.name)) log.info("Running in experiment mode! Name: {}".format(config.name))