-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.py
35 lines (27 loc) · 909 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
# -- coding: utf-8 --
from run_train import *
from model.hyparameter import parameter
def main(argv=None):
'''
:param argv:
:return:
'''
print('#......................................beginning........................................#')
para = parameter(argparse.ArgumentParser())
para = para.get_para()
print('Please input a number : 1 or 0. (1 and 0 represents the training or testing, respectively).')
val = input('please input the number : ')
if int(val) == 1:
para.is_training = True
else:
para.batch_size = 1
para.is_training = False
pre_model = Model(para)
pre_model.initialize_session()
if int(val) == 1:
pre_model.run_epoch()
else:
pre_model.evaluate()
print('#...................................finished............................................#')
if __name__ == '__main__':
main()