-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
53 lines (42 loc) · 1.76 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from cnnClassifier import logger
from cnnClassifier.pipeline.stage01_data_ingestion import DataIngestionTrainingPipeline
from cnnClassifier.pipeline.stage02_prepare_base_model import PrepareBaseModelTrainingPipeline
from cnnClassifier.pipeline.stage03_model_training import ModelTrainingPipeline
from cnnClassifier.pipeline.stage04_model_evaluation import ModelEvaluationPipeline
STAGE_NAME = "Data Ingestion stage"
try:
logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
obj = DataIngestionTrainingPipeline()
obj.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx================================================================================x")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME= "Prepare Base Model"
try:
logger.info(f"************************")
logger.info(f">>>>>>>stage: {STAGE_NAME} started<<<<<<")
prepare_base_model = PrepareBaseModelTrainingPipeline()
prepare_base_model.main()
logger.info(f">>>>>>>OK! stage: {STAGE_NAME} completed<<<<<<\n\nX===========X")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME= "Model Training Stage"
try:
logger.info(f">>>>>>>stage: {STAGE_NAME} started<<<<<<")
model_training = ModelTrainingPipeline()
model_training.main()
logger.info(f">>>>>>>stage: {STAGE_NAME} completed<<<<<<\n\nX===========X")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME= "Model Evaluation Stage"
try:
logger.info(f">>>>>>>stage: {STAGE_NAME} started<<<<<<")
model_eval = ModelEvaluationPipeline()
model_eval.main()
logger.info(f">>>>>>>stage: {STAGE_NAME} completed<<<<<<\n\nX===========X")
except Exception as e:
logger.exception(e)
raise e