Skip to content

Commit

Permalink
Shortened logdir
Browse files Browse the repository at this point in the history
  • Loading branch information
ancestor-mithril committed May 7, 2024
1 parent 86296bf commit 4578b00
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions utils/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ def init_logdir(self):
params = self.args.__dict__
params.pop('device')
params.pop('data_path')

params = [f'{k}_{v}' for k, v in params.items()]
params.pop('disable_progress_bar')
params.pop('half')
params.pop('num_threads')

no_keys = [
'dataset',
'scheduler'
'scheduler_params'
'model'
]

params = [f'{k}_{v}' if k not in no_keys else f'{v}' for k, v in params.items()]
params = [re.sub(r'[^a-zA-Z0-9_.-]', '_', x.replace(' ', '')) for x in params]
params = [re.sub('_+', '_', x) for x in params]

Expand Down

0 comments on commit 4578b00

Please sign in to comment.