Skip to content

Commit

Permalink
[fix] Deprecation issues with PL v1.7 (#2138)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Wessel <daniel.wessel@motius.de>
  • Loading branch information
alberttorosyan and djwessel authored Sep 1, 2022
1 parent faa11c4 commit 79507cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fix issue with remote runs re-open (mihran113)
- Deprecate custom set Run.hash values (alberttorosyan)
- Tune mlflow converter run properties (tmynn)
- Fix `AimLogger` deprecation issues related to release of PyTorch Lightning v1.7 (djwessel)

## 3.13.0 Aug 21, 2022

Expand Down
22 changes: 17 additions & 5 deletions aim/sdk/adapters/pytorch_lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
from argparse import Namespace

try:
from pytorch_lightning.loggers.base import (
LightningLoggerBase,
rank_zero_experiment,
)
import pytorch_lightning as pl

def versiontuple(v):
return tuple(map(int, (v.split("."))))

if versiontuple(pl.__version__) < (1, 7):
from pytorch_lightning.loggers.base import (
LightningLoggerBase as Logger,
rank_zero_experiment,
)
else:
from pytorch_lightning.loggers.logger import (
Logger,
rank_zero_experiment,
)

from pytorch_lightning.utilities import rank_zero_only
except ImportError:
raise RuntimeError(
Expand All @@ -20,7 +32,7 @@
from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT


class AimLogger(LightningLoggerBase):
class AimLogger(Logger):
def __init__(self,
repo: Optional[str] = None,
experiment: Optional[str] = None,
Expand Down

0 comments on commit 79507cd

Please sign in to comment.