def _build_callbacks(self):
"""Build callback objects.
Returns:
A list containing the following callback objects:
- TensorBoard
- ModelCheckpoint
"""
tensorboard_path = os.path.join(self.checkpoints_path, 'tensorboard')
tensorboard = TensorBoard(log_dir=tensorboard_path)
checkpoint_path = os.path.join(self.checkpoints_path, self.checkpoint_file_format)
checkpointer = ModelCheckpoint(filepath=checkpoint_path, verbose=1, save_best_only=self.save_best_only)
return [tensorboard, checkpointer]
评论列表
文章目录