From 0b0180406bbc2fa4042847433a6b7c50682c07df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Sat, 28 Mar 2020 16:30:57 +0100 Subject: [PATCH] Fix outdated docs follow up (#1266) * save_top_k * num_gpus * print_nan_grads fix leftovers * undo doctest removal --- docs/source/weights_loading.rst | 2 +- pytorch_lightning/core/lightning.py | 2 +- pytorch_lightning/trainer/__init__.py | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/source/weights_loading.rst b/docs/source/weights_loading.rst index 109adff6e0..2aebea1b17 100644 --- a/docs/source/weights_loading.rst +++ b/docs/source/weights_loading.rst @@ -35,7 +35,7 @@ To modify the behavior of checkpointing pass in your own callback. # DEFAULTS used by the Trainer checkpoint_callback = ModelCheckpoint( filepath=os.getcwd(), - save_best_only=True, + save_top_k=True, verbose=True, monitor='val_loss', mode='min', diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index 9cb5171d9f..4fe23ef7fc 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -799,7 +799,7 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks): Args: proc_rank: The current process rank within the node. - world_size: Number of GPUs being use across all nodes. (num_nodes*nb_gpu_nodes). + world_size: Number of GPUs being use across all nodes. (num_nodes * num_gpus). Examples: .. code-block:: python diff --git a/pytorch_lightning/trainer/__init__.py b/pytorch_lightning/trainer/__init__.py index 22d3e2d135..5c75bfc414 100644 --- a/pytorch_lightning/trainer/__init__.py +++ b/pytorch_lightning/trainer/__init__.py @@ -195,7 +195,7 @@ Example:: # default used by the Trainer checkpoint_callback = ModelCheckpoint( filepath=os.getcwd(), - save_best_only=True, + save_top_k=True, verbose=True, monitor='val_loss', mode='min', @@ -595,12 +595,11 @@ Example:: print_nan_grads ^^^^^^^^^^^^^^^ -Prints gradients with nan values +.. warning:: .. deprecated:: 0.7.2. -Example:: + Has no effect. When detected, NaN grads will be printed automatically. + Will remove 0.9.0. - # default used by the Trainer - trainer = Trainer(print_nan_grads=False) process_position ^^^^^^^^^^^^^^^^