Skip to content

Commit

Permalink
adds support for specifying log directory by command line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
janner committed Jan 21, 2020
1 parent 5cbe2fa commit adcd20a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def add_command_line_args_to_variant_spec(variant_spec, command_line_args):

def generate_experiment(trainable_class, variant_spec, command_line_args):
params = variant_spec.get('algorithm_params')
local_dir = os.path.join(params.get('log_dir'), params.get('domain'))
local_dir = os.path.join(
command_line_args.log_dir or params.get('log_dir'),
params.get('domain'))
resources_per_trial = _normalize_trial_resources(
command_line_args.resources_per_trial,
command_line_args.trial_cpus,
Expand Down
5 changes: 5 additions & 0 deletions examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ def get_parser(allow_policy_list=False):
# parser.add_argument(
# '--task', type=str, choices=AVAILABLE_TASKS, default=DEFAULT_TASK)

parser.add_argument(
'--log-dir',
type=str,
default=None,
)
parser.add_argument(
'--checkpoint-replay-pool',
type=lambda x: bool(strtobool(x)),
Expand Down

0 comments on commit adcd20a

Please sign in to comment.