Skip to content

Commit 272b4ca

Browse files
committed
Bump to lighting 2.0.*
1 parent 992a88e commit 272b4ca

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ packages=find:
1717
install_requires =
1818
# Add project specific dependencies
1919
# Stuff easy to break with updates
20-
pytorch-lightning==1.7.*
20+
lightning==2.0.*
2121
hydra-core
2222
wandb
2323

src/nn_core/model_logging.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from omegaconf import DictConfig, OmegaConf
1111
from pytorch_lightning import LightningModule, Trainer
1212
from pytorch_lightning.callbacks import ModelCheckpoint
13-
from pytorch_lightning.loggers import LightningLoggerBase
13+
from pytorch_lightning.loggers.logger import Logger
1414

1515
from nn_core.common import PROJECT_ROOT
1616

@@ -20,9 +20,9 @@
2020
_STATS_KEY: str = "stats"
2121

2222

23-
class NNLogger(LightningLoggerBase):
23+
class NNLogger(Logger):
2424

25-
__doc__ = LightningLoggerBase.__doc__
25+
__doc__ = Logger.__doc__
2626

2727
def __init__(self, logging_cfg: DictConfig, cfg: DictConfig, resume_id: Optional[str]):
2828
super().__init__()
@@ -39,7 +39,7 @@ def __init__(self, logging_cfg: DictConfig, cfg: DictConfig, resume_id: Optional
3939
self.logging_cfg.logger.mode = "offline"
4040

4141
pylogger.info(f"Instantiating <{self.logging_cfg.logger['_target_'].split('.')[-1]}>")
42-
self.wrapped: LightningLoggerBase = hydra.utils.instantiate(
42+
self.wrapped: Logger = hydra.utils.instantiate(
4343
self.logging_cfg.logger,
4444
version=self.resume_id,
4545
dir=os.getenv("WANDB_DIR", "."),
@@ -115,7 +115,7 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None):
115115
116116
This method logs metrics as as soon as it received them. If you want to aggregate
117117
metrics for one specific `step`, use the
118-
:meth:`~pytorch_lightning.loggers.base.LightningLoggerBase.agg_and_log_metrics` method.
118+
:meth:`~pytorch_lightning.loggers.base.Logger.agg_and_log_metrics` method.
119119
120120
Args:
121121
metrics: Dictionary with metric names as keys and measured quantities as values

0 commit comments

Comments
 (0)