Skip to content

Commit

Permalink
used current time as folder prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed May 17, 2021
1 parent 30e9689 commit 86b187c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion neural_monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def __setattr__(self, attr, val):

def initialize(self, model_name: Optional[str] = None, root: Optional[str] = None,
current_folder: Optional[str] = None, print_freq: Optional[int] = 1,
num_iters: Optional[int] = None, prefix: Optional[str] = 'run',
num_iters: Optional[int] = None, prefix: Optional[str] = None,
use_tensorboard: Optional[bool] = True, with_git: Optional[bool] = False,
not_found_warn=True) -> None:
"""
Expand Down Expand Up @@ -622,6 +622,10 @@ def prefix(self, p: str):
:return:
``None``.
"""
if p is None:
from datetime import datetime
now = datetime.now() # current date and time
p = now.strftime('%m.%d.%y-%H.%M.%S')

self._prefix = p

Expand Down

0 comments on commit 86b187c

Please sign in to comment.