File size: 682 Bytes
f0c1a1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'''
This file is used for end to end training from scratch and then, evaluation.
'''

from gcg.components import load_data, build_model, train_model, evaluate_model
from gcg import config
from gcg.utils import logging

logging.info("Initiated train pipeline")

logging.info(f"Loading data from {config.data_path}")
X_train, X_test, y_train, y_test = load_data(config.data_path, config.image_size)

logging.info("Building model...")
model = build_model(input_shape=config.image_size, num_classes=7)

logging.info("Training the model...")
train_model(model, X_train, X_test, y_train, y_test)

logging.info("Evaluating the model on test set...")
evaluate_model(model, X_test, y_test)