-
Notifications
You must be signed in to change notification settings - Fork 0
/
train
executable file
·32 lines (23 loc) · 835 Bytes
/
train
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
#!/usr/bin/env python
# A sample training component that trains a simple scikit-learn decision tree model.
# This implementation works in File mode and makes no assumptions about the input file names.
# Input is specified as CSV with a data point in each row and the labels in the first column.
from __future__ import print_function
import os
import hydra
os.environ["HYDRA_FULL_ERROR"] = "1"
import os.path as osp
import json
import pickle
import sys
import traceback
from omegaconf import DictConfig
from src.configs.train_config import *
from src.training import train
# https://hydra.cc/docs/next/tutorials/structured_config/hierarchical_static_config
@hydra.main(config_path="conf", config_name="config")
def my_app(cfg: DictConfig) -> None:
print(cfg.pretty())
train(cfg)
if __name__ == "__main__":
my_app()