-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
58 lines (44 loc) · 1.7 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
54
55
56
57
58
from ImageClassification.pipeline.stage_01_data_ingestion import DataIngestionTrainingPipeline
from ImageClassification.pipeline.stage_02_prepare_base_model import PrepareBaseModelTrainingPipeline
from ImageClassification.pipeline.stage_03_training import ModelTrainingPipeline
from ImageClassification.pipeline.stage_04_evaluation import EvaluationPipeline
from ImageClassification import logger
STAGE_NAME = "Data Ingestion stage"
try:
logger.info(f">>> stage {STAGE_NAME} started <<<")
data_ingestion = DataIngestionTrainingPipeline()
data_ingestion.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">>> stage {STAGE_NAME} completed <<<\n\nX======X")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = "Training"
try:
logger.info(f"**************************")
logger.info(f">>>>>>>> stage {STAGE_NAME} started <<<<<<<<<")
model_trainer = ModelTrainingPipeline()
model_trainer.main()
logger.info(f">>>>>>>>> stage {STAGE_NAME} completed")
except Exception as e:
logger.exception(e)
raise e
STAGE_NAME = "Evaluation stage"
try:
logger.info(f"**************************")
logger.info(f">>>>>>>> stage {STAGE_NAME} started <<<<<<<<<")
model_evaluation = EvaluationPipeline()
model_evaluation.main()
logger.info(f">>>>>>>>> stage {STAGE_NAME} completed")
except Exception as e:
logger.exception(e)
raise e