'Exports the model so that it can used for batch predictions.'

def export_model(self, model_dir, global_step_val, last_checkpoint):

    with self.graph.as_default():
        with tf.Session() as session:
            session.run(tf.global_variables_initializer())
            self.saver.restore(session, last_checkpoint)
            signature = signature_def_utils.build_signature_def(inputs=self.inputs, outputs=self.outputs, method_name=signature_constants.PREDICT_METHOD_NAME)
            signature_map = {signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: signature}
            model_builder = saved_model_builder.SavedModelBuilder(model_dir)
            model_builder.add_meta_graph_and_variables(session, tags=[tag_constants.SERVING], signature_def_map=signature_map, clear_devices=True)
            model_builder.save()
