logging active and clean
This commit is contained in:
@ -18,9 +18,7 @@ class Logger(LightningLoggerBase):
|
||||
|
||||
@property
|
||||
def log_dir(self):
|
||||
if self.debug:
|
||||
return Path(self.outpath)
|
||||
return Path(self.experiment.log_dir).parent
|
||||
return Path(self.testtubelogger.experiment.get_logdir()).parent
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
@ -32,14 +30,14 @@ class Logger(LightningLoggerBase):
|
||||
|
||||
@property
|
||||
def version(self):
|
||||
return f"version_{self.config.get('main', 'seed')}"
|
||||
return self.config.get('main', 'seed')
|
||||
|
||||
@property
|
||||
def outpath(self):
|
||||
# ToDo: Add further path modification such as dataset config etc.
|
||||
return Path(self.config.train.outpath)
|
||||
|
||||
def __init__(self, config: Config, debug=False):
|
||||
def __init__(self, config: Config):
|
||||
"""
|
||||
params (dict|None): Optional. Parameters of the experiment. After experiment creation params are read-only.
|
||||
Parameters are displayed in the experiment’s Parameters section and each key-value pair can be
|
||||
@ -53,8 +51,8 @@ class Logger(LightningLoggerBase):
|
||||
"""
|
||||
super(Logger, self).__init__()
|
||||
|
||||
self.debug = debug
|
||||
self.config = config
|
||||
self.debug = self.config.main.debug
|
||||
self._testtube_kwargs = dict(save_dir=self.outpath, version=self.version, name=self.name)
|
||||
self._neptune_kwargs = dict(offline_mode=self.debug,
|
||||
api_key=self.config.project.neptune_key,
|
||||
@ -68,9 +66,9 @@ class Logger(LightningLoggerBase):
|
||||
self.testtubelogger.log_hyperparams(params)
|
||||
pass
|
||||
|
||||
def log_metrics(self, metrics, step_num):
|
||||
self.neptunelogger.log_metrics(metrics, step_num)
|
||||
self.testtubelogger.log_metrics(metrics, step_num)
|
||||
def log_metrics(self, metrics, step=None):
|
||||
self.neptunelogger.log_metrics(metrics, step=step)
|
||||
self.testtubelogger.log_metrics(metrics, step=step)
|
||||
pass
|
||||
|
||||
def log_config_as_ini(self):
|
||||
|
Reference in New Issue
Block a user