def _get_callbacks(self):
"""Return callbacks to pass into the Model.fit method
Note: This simply returns statically instantiated callbacks. In the
future it could be altered to allow for callbacks that are specified
and configured via a training config.
"""
fpath_history = os.path.join(self.output_dir, 'history.csv')
fpath_weights = os.path.join(self.output_dir, 'weights.h5')
csv_logger = CSVLogger(filename=fpath_history)
model_checkpoint = ModelCheckpoint(
filepath=fpath_weights, verbose=True
)
callbacks = [csv_logger, model_checkpoint]
return callbacks
评论列表
文章目录