def train_model(self):
Train the model with dataset and return the minimum_loss
self.training_losses = []
self._no_improvement_count = 0
self.minimum_loss = float("inf")
batch_size = min(self.x_train.shape[0], 200)
if constant.DATA_AUGMENTATION:
After Change
if constant.LIMIT_MEMORY:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
backend.set_session(sess)
try:
if constant.DATA_AUGMENTATION:
flow = self.datagen.flow(self.x_train, self.y_train, batch_size)