-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_train.py
88 lines (67 loc) · 1.99 KB
/
run_train.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import sys
import numpy as np
#import tensorflow.compat.v1 as tf
import tensorflow as tf
#tf.compat.v1.disable_eager_execution()
from nets import *
from cfgs import *
from data import *
from clip_ops.clip_ops import *
from trainer import *
print(("Setting: %s"%(sys.argv[1])))
setting = sys.argv[1]
if setting == "aaa3":
cfg = aaa3.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "a":
cfg = a.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "d":
cfg = d.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "e":
cfg = e.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "f":
cfg = f.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "g":
cfg = g.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "h":
cfg = h.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
elif setting == "Integrated_A":
cfg = Integrated_A.cfg
Net = unit_net.Net
Generator = uniform_01_generator.Generator
clip_op_lambda = (lambda x: clip_op_01(x))
Trainer = trainer.Trainer
else:
print("None selected")
sys.exit(0)
net = Net(cfg)
generator = [Generator(cfg, 'train'), Generator(cfg, 'val'), Generator(cfg, 'test')]
m = Trainer(cfg, "train", net, clip_op_lambda)
m.train(generator)