-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (33 loc) · 1.05 KB
/
Copy pathmain.py
File metadata and controls
37 lines (33 loc) · 1.05 KB
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
import yaml
# import your packages
# do not rename the functions
def main(dataset_path, output_path):
"""
main entry point of training function
:param dataset_path: path to the directory contains dataset
:param output_path: path to a directory for outputs
:return:
"""
print("start running training job")
with open("./config.yaml", 'r') as f:
config = yaml.load(f)
# invoke your training function
# to test your code locally, you can either run main.py directly
# such as "python main.py --dataset_path=<path> --output_path=<path>"
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'-d',
'--dataset_path',
type=str,
required=True,
help='Path to the directory contains dataset')
parser.add_argument(
'-o',
'--output_path',
type=str,
required=True,
help='Path to a directory for outputs')
FLAGS, _ = parser.parse_known_args()
main(FLAGS.dataset_path, FLAGS.output_path)