Skip to content

Commit

Permalink
The user can specify the roots of experiments in the config.path (XPi…
Browse files Browse the repository at this point in the history
…xelGroup#595)

* The user can specify the roots of experiments in the config.path

* Update the path augmentation by adding the exp NAME
  • Loading branch information
ljzycmd authored Feb 2, 2023
1 parent 5521283 commit 62cff6e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions basicsr/utils/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ def parse_options(root_path, is_train=True):
opt['path'][key] = osp.expanduser(val)

if is_train:
experiments_root = osp.join(root_path, 'experiments', opt['name'])
experiments_root = opt['path'].get('experiments_root')
if experiments_root is None:
experiments_root = osp.join(root_path, 'experiments')
experiments_root = osp.join(experiments_root, opt['name'])

opt['path']['experiments_root'] = experiments_root
opt['path']['models'] = osp.join(experiments_root, 'models')
opt['path']['training_states'] = osp.join(experiments_root, 'training_states')
Expand All @@ -185,7 +189,11 @@ def parse_options(root_path, is_train=True):
opt['logger']['print_freq'] = 1
opt['logger']['save_checkpoint_freq'] = 8
else: # test
results_root = osp.join(root_path, 'results', opt['name'])
results_root = opt['path'].get('results_root')
if results_root is None:
results_root = osp.join(root_path, 'results')
results_root = osp.join(results_root, opt['name'])

opt['path']['results_root'] = results_root
opt['path']['log'] = results_root
opt['path']['visualization'] = osp.join(results_root, 'visualization')
Expand Down

0 comments on commit 62cff6e

Please sign in to comment.