-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
35 lines (26 loc) · 888 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import argparse
from joblib import delayed, Parallel
from configs.default_cfg import get_cfg_defaults
from utils.experiment import run_experiment
def arg_parse():
"""Parsing arguments"""
parser = argparse.ArgumentParser(
description="GSDA brain hemispheres classification"
)
parser.add_argument("--cfg", required=True, help="path to config file", type=str)
# parser.add_argument("--gpus", default=None, help="gpu id(s) to use", type=str)
parser.add_argument("--resume", default="", type=str)
args = parser.parse_args()
return args
def main():
args = arg_parse()
# ---- setup configs ----
cfg = get_cfg_defaults()
cfg.merge_from_file(args.cfg)
cfg.freeze()
print(cfg)
Parallel(n_jobs=2)(
delayed(run_experiment)(cfg, lambda_) for lambda_ in cfg.SOLVER.LAMBDA_
)
if __name__ == "__main__":
main()