forked from andregraubner/ClimateNet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
32 lines (29 loc) · 1009 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
import argparse
from climatenet_plus.base_model import train, evaluate
from climatenet_plus.climatenet.utils.utils import Config
from cl.model import curriculum_train, curriculum_evaluate
from configparser import ConfigParser
def run(args):
if args.model == "base":
config = Config('climatenet_plus/config.json')
if args.mode == "train":
train(config)
else:
evaluate(config)
else:
if args.mode == "train":
config = ConfigParser()
config.read('cl/config.yaml')
curriculum_train(config)
else:
config = ConfigParser()
config.read('cl/config.yaml')
curriculum_evaluate(config)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--model", choices=["base", "curriculum"], required=True)
parser.add_argument("--mode", choices=["train", "eval"], required=True)
args = parser.parse_args()
run(args)
if __name__=="__main__":
main()