-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
39 lines (31 loc) · 883 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
36
37
38
39
"""
@Author: zhkun
@Time: 18:04
@File: main
@Description: main entrance
@Something to attention
"""
import warnings
warnings.filterwarnings(action='ignore', category=FutureWarning)
warnings.filterwarnings('ignore', category=DeprecationWarning)
warnings.filterwarnings('ignore', category=UserWarning)
warnings.filterwarnings("ignore")
import os
from my_parser import parser
from solverV2 import Solver as Solverv2, SolverDouble
def main():
args = parser()
os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu
os.environ['TOKENIZERS_PARALLELISM'] = "false"
if args.net in ['led', 'ledv2']:
solver = Solverv2(args)
elif args.net == 'ledr2':
solver = SolverDouble(args)
else:
raise ValueError('the key word is not exist')
if not args.test:
solver.train()
else:
solver.test()
if __name__ == '__main__':
main()