mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
update deprecated messages (#810)
* update deprecated messages * formatting * fix docs tags
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
:class: hidden-section
|
||||
|
||||
Callbacks
|
||||
===========
|
||||
=========
|
||||
.. automodule:: pytorch_lightning.callbacks
|
||||
:exclude-members:
|
||||
_del_model,
|
||||
|
||||
+3
-1
@@ -348,8 +348,10 @@ def linkcode_resolve(domain, info):
|
||||
|
||||
autodoc_member_order = 'groupwise'
|
||||
autoclass_content = 'both'
|
||||
# the options are fixed and will be soon in release,
|
||||
# see https://github.com/sphinx-doc/sphinx/issues/5459
|
||||
autodoc_default_options = {
|
||||
'members': True,
|
||||
'members': None,
|
||||
'special-members': '__call__',
|
||||
'undoc-members': True,
|
||||
# 'exclude-members': '__weakref__',
|
||||
|
||||
@@ -2,7 +2,7 @@ Experiment Logging
|
||||
===================
|
||||
|
||||
Comet.ml
|
||||
^^^^^^^^^^
|
||||
^^^^^^^^
|
||||
|
||||
`Comet.ml <https://www.comet.ml/site/>`_ is a third-party logger.
|
||||
To use CometLogger as your logger do the following.
|
||||
@@ -63,7 +63,7 @@ The Neptune.ai is available anywhere in your LightningModule
|
||||
self.logger.experiment.add_image('generated_images', some_img, 0)
|
||||
|
||||
Tensorboard
|
||||
^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^
|
||||
|
||||
To use `Tensorboard <https://pytorch.org/docs/stable/tensorboard.html>`_ as your logger do the following.
|
||||
|
||||
@@ -88,7 +88,7 @@ The TensorBoardLogger is available anywhere in your LightningModule
|
||||
|
||||
|
||||
Test Tube
|
||||
^^^^^^^^^^^^^
|
||||
^^^^^^^^^
|
||||
|
||||
`Test Tube <https://github.com/williamFalcon/test-tube>`_ is a tensorboard logger but with nicer file structure.
|
||||
To use TestTube as your logger do the following.
|
||||
@@ -113,7 +113,7 @@ The TestTubeLogger is available anywhere in your LightningModule
|
||||
self.logger.experiment.add_image('generated_images', some_img, 0)
|
||||
|
||||
Wandb
|
||||
^^^^^^^^^^^^^
|
||||
^^^^^
|
||||
|
||||
`Wandb <https://www.wandb.com/>`_ is a third-party logger.
|
||||
To use Wandb as your logger do the following.
|
||||
|
||||
@@ -7,7 +7,7 @@ used in each experiment.
|
||||
|
||||
|
||||
Control logging frequency
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
It may slow training down to log every single batch. Trainer has an option to log every k batches instead.
|
||||
|
||||
@@ -17,7 +17,7 @@ It may slow training down to log every single batch. Trainer has an option to lo
|
||||
Trainer(row_log_interval=10)
|
||||
|
||||
Control log writing frequency
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Writing to a logger can be expensive. In Lightning you can set the interval at which you
|
||||
want to log using this trainer flag.
|
||||
@@ -30,7 +30,7 @@ want to log using this trainer flag.
|
||||
Trainer(log_save_interval=k)
|
||||
|
||||
Log metrics
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^
|
||||
|
||||
To plot metrics into whatever logger you passed in (tensorboard, comet, neptune, etc...)
|
||||
|
||||
@@ -90,7 +90,7 @@ For instance, here we log images using tensorboard.
|
||||
return results
|
||||
|
||||
Modify progress bar
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Each return dict from the training_end, validation_end, testing_end and training_step also has
|
||||
a key called "progress_bar".
|
||||
@@ -108,7 +108,7 @@ Here we show the validation loss in the progress bar
|
||||
return results
|
||||
|
||||
Snapshot hyperparameters
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
When training a model, it's useful to know what hyperparams went into that model.
|
||||
When Lightning creates a checkpoint, it stores a key "hparams" with the hyperparams.
|
||||
|
||||
@@ -122,7 +122,7 @@ when using the TestTubeLogger or the TensorBoardLogger, all hyperparams will sho
|
||||
in the `hparams tab <https://pytorch.org/docs/stable/tensorboard.html#torch.utils.tensorboard.writer.SummaryWriter.add_hparams>`_.
|
||||
|
||||
Snapshot code
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^
|
||||
Loggers also allow you to snapshot a copy of the code used in this experiment.
|
||||
For example, TestTubeLogger does this with a flag:
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ To run the test set after training completes, use this method
|
||||
|
||||
|
||||
Test pre-trained model
|
||||
-----------------
|
||||
----------------------
|
||||
To run the test set on a pretrained model, use this method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
:class: hidden-section
|
||||
|
||||
Trainer
|
||||
===========
|
||||
=======
|
||||
|
||||
.. automodule:: pytorch_lightning.trainer
|
||||
:members: fit, test
|
||||
:exclude-members:
|
||||
|
||||
@@ -376,7 +376,7 @@ class GradientAccumulationScheduler(Callback):
|
||||
|
||||
Args:
|
||||
scheduling (dict): scheduling in format {epoch: accumulation_factor}
|
||||
warning:: Epochs indexing starts from "1" until v0.6.x, but will start from "0" in v0.8.0.
|
||||
.. warning:: Epochs indexing starts from "1" until v0.6.x, but will start from "0" in v0.8.0.
|
||||
|
||||
Example::
|
||||
|
||||
|
||||
@@ -898,14 +898,14 @@ class LightningModule(ABC, GradInformation, ModelIO, ModelHooks):
|
||||
"""
|
||||
|
||||
@data_loader
|
||||
def tng_dataloader(self):
|
||||
def tng_dataloader(self): # todo: remove in v0.8.0
|
||||
"""Implement a PyTorch DataLoader.
|
||||
|
||||
.. warning:: Deprecated in v0.5.0. use train_dataloader instead.
|
||||
"""
|
||||
output = self.train_dataloader()
|
||||
warnings.warn("`tng_dataloader` has been renamed to `train_dataloader` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`tng_dataloader` has been renamed to `train_dataloader` since v0.5.0."
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
return output
|
||||
|
||||
@data_loader
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""
|
||||
.. warning:: `model_saving` module has been renamed to `saving` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `model_saving` module has been renamed to `saving` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`model_saving` module has been renamed to `saving` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`model_saving` module has been renamed to `saving` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.core.saving import ModelIO # noqa: E402
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
"""
|
||||
.. warning:: `root_module` module has been renamed to `lightning` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `root_module` module has been renamed to `lightning` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`root_module` module has been renamed to `lightning` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`root_module` module has been renamed to `lightning` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""
|
||||
.. warning:: `comet_logger` module has been renamed to `comet` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `comet_logger` module has been renamed to `comet` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`comet_logger` module has been renamed to `comet` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`comet_logger` module has been renamed to `comet` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.loggers.comet import CometLogger # noqa: E402
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""
|
||||
.. warning:: `mlflow_logger` module has been renamed to `mlflow` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `mlflow_logger` module has been renamed to `mlflow` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`mlflow_logger` module has been renamed to `mlflow` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`mlflow_logger` module has been renamed to `mlflow` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.loggers.mlflow import MLFlowLogger # noqa: E402
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""
|
||||
.. warning:: `test_tube_logger` module has been renamed to `test_tube` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `test_tube_logger` module has been renamed to `test_tube` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`test_tube_logger` module has been renamed to `test_tube` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`test_tube_logger` module has been renamed to `test_tube` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.loggers.test_tube import TestTubeLogger # noqa: E402
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""
|
||||
.. warning:: `logging` package has been renamed to `loggers` since v0.6.1 and will be removed in v0.8.0
|
||||
.. warning:: `logging` package has been renamed to `loggers` since v0.6.1.
|
||||
The deprecated package name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`logging` package has been renamed to `loggers` since v0.6.1"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" The deprecated package name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.loggers import * # noqa: F403
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
"""
|
||||
.. warning:: `override_data_parallel` module has been renamed to `data_parallel` since v0.6.0
|
||||
and will be removed in v0.8.0
|
||||
.. warning:: `override_data_parallel` module has been renamed to `data_parallel` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`override_data_parallel` module has been renamed to `data_parallel` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`override_data_parallel` module has been renamed to `data_parallel` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.overrides.data_parallel import ( # noqa: E402
|
||||
get_a_var, parallel_apply, LightningDataParallel, LightningDistributedDataParallel)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"""
|
||||
.. warning:: `pt_overrides` package has been renamed to `overrides` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `pt_overrides` package has been renamed to `overrides` since v0.6.0.
|
||||
The deprecated module name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`pt_overrides` package has been renamed to `overrides` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`pt_overrides` package has been renamed to `overrides` since v0.6.0."
|
||||
" The deprecated module name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.overrides import override_data_parallel # noqa: E402
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
"""
|
||||
.. warning:: `root_module` package has been renamed to `core` since v0.6.0 and will be removed in v0.8.0
|
||||
.. warning:: `root_module` package has been renamed to `core` since v0.6.0.
|
||||
The deprecated package name will be removed in v0.8.0.
|
||||
"""
|
||||
|
||||
import warnings
|
||||
|
||||
warnings.warn("`root_module` package has been renamed to `core` since v0.6.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
warnings.warn("`root_module` package has been renamed to `core` since v0.6.0."
|
||||
" The deprecated package name will be removed in v0.8.0.", DeprecationWarning)
|
||||
|
||||
from pytorch_lightning.core import ( # noqa: E402
|
||||
decorators, grads, hooks, root_module, memory, model_saving
|
||||
|
||||
@@ -499,7 +499,7 @@ class Trainer(TrainerIOMixin,
|
||||
# Backward compatibility
|
||||
if nb_gpu_nodes is not None:
|
||||
warnings.warn("`nb_gpu_nodes` has renamed to `num_nodes` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
if not num_nodes: # in case you did not set the proper value
|
||||
num_nodes = nb_gpu_nodes
|
||||
self.num_gpu_nodes = num_nodes
|
||||
@@ -509,7 +509,7 @@ class Trainer(TrainerIOMixin,
|
||||
# Backward compatibility
|
||||
if gradient_clip is not None:
|
||||
warnings.warn("`gradient_clip` has renamed to `gradient_clip_val` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
if not gradient_clip_val: # in case you did not set the proper value
|
||||
gradient_clip_val = gradient_clip
|
||||
self.gradient_clip_val = gradient_clip_val
|
||||
@@ -523,7 +523,7 @@ class Trainer(TrainerIOMixin,
|
||||
# Backward compatibility
|
||||
if max_nb_epochs is not None:
|
||||
warnings.warn("`max_nb_epochs` has renamed to `max_epochs` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
if not max_epochs: # in case you did not set the proper value
|
||||
max_epochs = max_nb_epochs
|
||||
self.max_epochs = max_epochs
|
||||
@@ -531,7 +531,7 @@ class Trainer(TrainerIOMixin,
|
||||
# Backward compatibility
|
||||
if min_nb_epochs is not None:
|
||||
warnings.warn("`min_nb_epochs` has renamed to `min_epochs` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
if not min_epochs: # in case you did not set the proper value
|
||||
min_epochs = min_nb_epochs
|
||||
self.min_epochs = min_epochs
|
||||
@@ -539,7 +539,7 @@ class Trainer(TrainerIOMixin,
|
||||
# Backward compatibility
|
||||
if nb_sanity_val_steps is not None:
|
||||
warnings.warn("`nb_sanity_val_steps` has renamed to `num_sanity_val_steps` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
if not num_sanity_val_steps: # in case you did not set the proper value
|
||||
num_sanity_val_steps = nb_sanity_val_steps
|
||||
|
||||
@@ -642,7 +642,7 @@ class Trainer(TrainerIOMixin,
|
||||
# backward compatibility
|
||||
if add_row_log_interval is not None:
|
||||
warnings.warn("`add_row_log_interval` has renamed to `row_log_interval` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
if not row_log_interval: # in case you did not set the proper value
|
||||
row_log_interval = add_row_log_interval
|
||||
self.row_log_interval = row_log_interval
|
||||
@@ -728,7 +728,7 @@ class Trainer(TrainerIOMixin,
|
||||
Use `training_tqdm_dict` instead. Will remove 0.8.0.
|
||||
"""
|
||||
warnings.warn("`tng_tqdm_dic` has renamed to `training_tqdm_dict` since v0.5.0"
|
||||
" and will be removed in v0.8.0", DeprecationWarning)
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
return self.training_tqdm_dict
|
||||
|
||||
# -----------------------------
|
||||
|
||||
Reference in New Issue
Block a user