import tensorflow as tf

    saver = tf.train.Saver(max_to_keep=None)
    if self.is_summary:
      training_batch_summary_op = tf.merge_all_summaries(key=TRAINING_BATCH_SUMMARIES)
      training_epoch_summary_op = tf.merge_all_summaries(key=TRAINING_EPOCH_SUMMARIES)
      validation_batch_summary_op = tf.merge_all_summaries(key=VALIDATION_BATCH_SUMMARIES)
      validation_epoch_summary_op = tf.merge_all_summaries(key=VALIDATION_EPOCH_SUMMARIES)

    # Build an initialization operation to run below.
    init = tf.global_variables_initializer()

    gpu_options = tf.GPUOptions(
        per_process_gpu_memory_fraction=self.cnf.get('gpu_memory_fraction', 0.9))
    sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True, gpu_options=gpu_options))
    sess.run(init)
    if start_epoch > 1:
      weights_from = "weights/model-epoch-%d.ckpt" % (start_epoch - 1)

    if weights_from:
      self._load_weights(sess, saver, weights_from)

    learning_rate_value = self.lr_policy.initial_lr
    log.info("Initial learning rate: %f " % learning_rate_value)
    if self.is_summary:
      train_writer, validation_writer = summary.create_summary_writer(
