def parse_args(): parser = argparse.ArgumentParser() # shared params parser.add_argument("--config_path", "-c", type=str, default=None, help="Path for config yaml", required=True) parser.add_argument("--dataplace", "-dp", type=str, default=None, help="Parent folder to data", required=True) parser.add_argument("--saveplace", "-sp", type=str, default=None, help="Parent folder to save", required=True) parser.add_argument("--gpu", "-g", default="0", type=str, help="Selecting gpu. If not exists, then cpu") parser.add_argument("--debug", type=int, default=0, help="Debug mode: 0, 1 or 2. The more the more debug.") # specific params parser.add_argument( "--from_scratch", "-f", action="store_true", default=False, help="Force training from scratch", ) parser.add_argument( "--seed", default=config.cfg.RANDOM.SEED, type=int, help="Random seed", ) # parse args = parser.parse_args() misc.print_args(args) return args
def parse_args(): parser = argparse.ArgumentParser() # shared params parser.add_argument("--config_path", "-c", type=str, default=None, help="Path for config yaml", required=True) parser.add_argument("--dataplace", "-dp", type=str, default=None, help="Parent folder to data", required=True) parser.add_argument( "--saveplace", "-sp", type=str, default=None, help= "Parent folder to save. Not required when checkpoint is directly provided.", required=False) parser.add_argument("--gpu", "-g", default="0", type=str, help="Selecting gpu. If not exists, then cpu") parser.add_argument("--debug", type=int, default=0, help="Debug mode: 0, 1 or 2. The more the more debug.") # specific params parser.add_argument( "--checkpoint", type=str, default="best", help= "Can be either: 1. 'best' and we will select the best epoch 2. an int that indicates the epoch 3. A precise path to checkpoint." ) parser.add_argument( "--corruptions", default=False, action='store_true', help= "Apply corruptions from Benchmarking Neural Network corruptions to Common Corruptions and Perturbations", # https://github.com/hendrycks/corruptions ) parser.add_argument("--tempscale", default=False, action='store_true', help="Apply tempscale") # parse args = parser.parse_args() misc.print_args(args) return args
def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( "--template_path", "-t", type=str, default="scripts/exp_mixmo_template.yaml", help="Path to config template" ) parser.add_argument( "--config_dir", "-c", type=str, default="config/", help="Folder to save these new configs" ) parser.add_argument( "--dataset", default="cifar100", help="dataset name", ) args = parser.parse_args() misc.print_args(args) return args