import tensorflow as tf

        It is probably a good idea since the whole session must be later be restored by the ChiefSession
        """
        os.makedirs(self._checkpoint_dir, exist_ok=True)
        #variables = tf.trainable_variables()
        self._saver = tf.train.Saver(variables, max_to_keep=max_to_keep, save_relative_paths=True)

    def _save_graph(self):
        writer = tf.summary.FileWriter(logdir=self._checkpoint_dir,
                                       # graph=self.sess.graph,
                                       graph=tf.get_default_graph(),
                                       filename_suffix="-graph"
                                       )
        writer.flush()

    def _assemble_checkpoint_name(self, checkpoint_dir):
        path = os.path.join(checkpoint_dir, "model.ckpt")
        return path

