-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (21 loc) · 711 Bytes
/
main.py
File metadata and controls
36 lines (21 loc) · 711 Bytes
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
#!/usr/bin/python3
import logging
import os
import pprint
from utils import setup_logging, load_config, parse_args,set_output_dir
from tools import train
LOGGER = logging.getLogger(__name__)
def main():
# 读取config文件
args = parse_args()
os.environ["CUDA_VISIBLE_DEVICES"] = args.device
for path_to_config in args.cfg_files:
cfg = load_config(args, path_to_config=path_to_config)
cfg = set_output_dir(cfg)
setup_logging(cfg)
LOGGER.info(pprint.pformat(cfg))
train(cfg=cfg)
LOGGER.info("All done!")
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
main()