"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "aeb2cab1cd593231ef38f80827cb502973825354"
Commit ae40f1c2 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: add --force parameter to run even if output present

parent bffe71e4
...@@ -21,6 +21,8 @@ parser.add_argument('--runs', metavar='N', type=int, default=1, ...@@ -21,6 +21,8 @@ parser.add_argument('--runs', metavar='N', type=int, default=1,
help='Number of repetition for each experiment') help='Number of repetition for each experiment')
parser.add_argument('--firstrun', metavar='N', type=int, default=1, parser.add_argument('--firstrun', metavar='N', type=int, default=1,
help='ID for first run') help='ID for first run')
parser.add_argument('--force', action='store_const', const=True, default=False,
help='Run experiments even if output already exists')
parser.add_argument('--verbose', action='store_const', const=True, parser.add_argument('--verbose', action='store_const', const=True,
default=False, default=False,
help='Verbose output') help='Verbose output')
...@@ -66,7 +68,7 @@ else: ...@@ -66,7 +68,7 @@ else:
def add_exp(e, run, prereq, create_cp, restore_cp): def add_exp(e, run, prereq, create_cp, restore_cp):
outpath = '%s/%s-%d.json' % (args.outdir, e.name, run) outpath = '%s/%s-%d.json' % (args.outdir, e.name, run)
if os.path.exists(outpath): if os.path.exists(outpath) and not args.force:
print('skip %s run %d' % (e.name, run)) print('skip %s run %d' % (e.name, run))
return None return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment