class_docstr: A driver for running eval inference.
  
  Attributes:
    model_name: str. Model name to eval.
    batch_size: int. Eval batch size.
    image_size: int. Input image size, determined by model name.
    num_classes: int. Number of classes, default to 1000 for ImageNet.
    include_background_label: whether to include extra background label.
class_docstr_tok: ["A","driver","for","running","eval","inference",".","Attributes",":","model_name",":","str",".","Model","name","to","eval",".","batch_size",":","int",".","Eval","batch","size",".","image_size",":","int",".","Input","image","size",",","determined","by","model","name",".","num_classes",":","int",".","Number","of","classes",",","default","to","1000","for","ImageNet",".","include_background_label",":","whether","to","include","extra","background","label","."]
docstr: Restore variables from checkpoint dir.
docstr_tok: ["Restore","variables","from","checkpoint","dir","."]
code: def restore_model(
      self, sess, ckpt_dir, enable_ema=True, export_ckpt=None
  ):
      """Restore variables from checkpoint dir."""
      sess.run(tf.global_variables_initializer())
      checkpoint = tf.train.latest_checkpoint(ckpt_dir)
      if enable_ema:
          ema = tf.train.ExponentialMovingAverage(decay=0.0)
          ema_vars = get_ema_vars()
          var_dict = ema.variables_to_restore(ema_vars)
          ema_assign_op = ema.apply(ema_vars)
      else:
          var_dict = get_ema_vars()
          ema_assign_op = None
  
      tf.train.get_or_create_global_step()
      sess.run(tf.global_variables_initializer())
      saver = tf.train.Saver(var_dict, max_to_keep=1)
      saver.restore(sess, checkpoint)
  
      if export_ckpt:
          if ema_assign_op is not None:
              sess.run(ema_assign_op)
          saver = tf.train.Saver(
              max_to_keep=1, save_relative_paths=True
          )
          saver.save(sess, export_ckpt)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  import os
  import sys
  from absl import logging
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python.tpu import tpu_function
label_desc: Use image node_id 2 for calling the EvalCkptDriver obj's underlying member method code with example usage: obj.restore_model(sess, ckpt_dir, enable_ema, export_ckpt) without return types