Skip to content

Commit f97012d

Browse files
author
otaj
committed
create run if not existing yet
1 parent bdcba72 commit f97012d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/pytorch_lightning/loggers/neptune.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,17 +619,21 @@ def _dict_paths(cls, d: Dict[str, Any], path_in_build: str = None) -> Generator:
619619
@property
620620
def name(self) -> str:
621621
"""Return the experiment name or 'offline-name' when exp is run in offline mode."""
622-
if self._run_name is not None:
623-
return self._run_name
622+
if self._run_name is None:
623+
_ = self.run
624+
assert self._run_name is not None
625+
return self._run_name
624626

625627
@property
626628
def version(self) -> str:
627629
"""Return the experiment version.
628630
629631
It's Neptune Run's short_id
630632
"""
631-
if self._run_short_id is not None:
632-
return self._run_short_id
633+
if self._run_short_id is None:
634+
_ = self.run
635+
assert self._run_short_id is not None
636+
return self._run_short_id
633637

634638
@staticmethod
635639
def _signal_deprecated_api_usage(f_name: str, sample_code: str, raise_exception: bool = False) -> None:

0 commit comments

Comments
 (0)