Пример #1
0
def parse_args():
    from docopt import docopt
    args = docopt(__doc__)
    args = {k.strip('--').replace('-', '_'): v for k, v in args.items()}
    del args['h']
    del args['help']
    args = DotDict(args)
    args.logdir = parse_path(args.logdir)
    # TODO implement Option utility
    epoch_option = parse_none(args.epoch)
    if epoch_option:
        args.epoch = int(float(epoch_option))
    else:
        args.epoch = epoch_option
    args.gpu_id = int(args.gpu_id)
    args.nb_episode = int(args.nb_episode)
    args.start = float(args.start)
    args.end = float(args.end)
    args.seed = int(args.seed)
    return args
Пример #2
0
def parse_args():
    from docopt import docopt

    args = docopt(__doc__)
    args = {k.strip("--").replace("-", "_"): v for k, v in args.items()}
    del args["h"]
    del args["help"]
    args = DotDict(args)

    args.logdir = parse_path(args.logdir)

    # TODO implement Option utility
    epoch_option = parse_none(args.epoch)
    if epoch_option:
        args.epoch = int(float(epoch_option))
    else:
        args.epoch = epoch_option
    args.start = int(float(args.start))
    args.end = int(float(args.end))
    args.gpu_id = int(args.gpu_id)
    args.seed = int(args.seed)
    return args