update log_dir to runs/exp #107
This commit is contained in:
1 parent
72d5b58b9a
commit
603ea0bfdc
2 files changed
+11
-1
No files matched your search
@@ -396,7 +396,7 @@ if __name__ == '__main__':
|
|||||||
# Train
|
# Train
|
||||||
if not opt.evolve:
|
if not opt.evolve:
|
||||||
print('Start Tensorboard with "tensorboard --logdir=runs", view at http://localhost:6006/')
|
print('Start Tensorboard with "tensorboard --logdir=runs", view at http://localhost:6006/')
|
||||||
tb_writer = SummaryWriter(comment=opt.name)
|
tb_writer = SummaryWriter(log_dir=increment_dir('runs/exp', opt.name))
|
||||||
if opt.hyp: # update hyps
|
if opt.hyp: # update hyps
|
||||||
with open(opt.hyp) as f:
|
with open(opt.hyp) as f:
|
||||||
hyp.update(yaml.load(f, Loader=yaml.FullLoader))
|
hyp.update(yaml.load(f, Loader=yaml.FullLoader))
|
||||||
|
|||||||
@@ -904,6 +904,16 @@ def output_to_target(output, width, height):
|
|||||||
return np.array(targets)
|
return np.array(targets)
|
||||||
|
|
||||||
|
|
||||||
|
def increment_dir(dir, comment=''):
|
||||||
|
# Increments a directory runs/exp1 --> runs/exp2_comment
|
||||||
|
n = 0 # number
|
||||||
|
d = sorted(glob.glob(dir + '*')) # directories
|
||||||
|
if len(d):
|
||||||
|
d = d[-1].replace(dir, '')
|
||||||
|
n = int(d[:d.find('_')]) + 1 # increment
|
||||||
|
return dir + str(n) + ('_' + comment if comment else '')
|
||||||
|
|
||||||
|
|
||||||
# Plotting functions ---------------------------------------------------------------------------------------------------
|
# Plotting functions ---------------------------------------------------------------------------------------------------
|
||||||
def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5):
|
def butter_lowpass_filtfilt(data, cutoff=1500, fs=50000, order=5):
|
||||||
# https://stackoverflow.com/questions/28536191/how-to-filter-smooth-with-scipy-numpy
|
# https://stackoverflow.com/questions/28536191/how-to-filter-smooth-with-scipy-numpy
|
||||||
|
|||||||
Reference in new issue
Block a user