class_docstr: This class handles restoring the model at the beginning of a session.
class_docstr_tok: ["This","class","handles","restoring","the","model","at","the","beginning","of","a","session","."]
code: def __init__(
      self,
      model_dir,
      initial_iter=0,
      is_training_action=True,
      vars_to_restore=None,
      **_unused,
  ):
      self.initial_iter = initial_iter
      self.vars_to_restore = vars_to_restore
      self.file_name_prefix = make_model_name(model_dir)
      # randomly initialise or restoring model
      if is_training_action and initial_iter == 0:
          SESS_STARTED.connect(self.rand_init_model)
      else:
          SESS_STARTED.connect(self.restore_model)
  
file_path: NiftyNet/niftynet/engine/handler_model.py
imports: import os
  import tensorflow
  from niftynet.engine.application_variables import global_vars_init_or_restore
  from niftynet.engine.signal import ITER_FINISHED, SESS_FINISHED, SESS_STARTED
  from niftynet.io.misc_io import touch_folder
label_desc: Use image node_id 1 to create a new ModelRestorer object from inherited base classes: object with example: obj = ModelRestorer(model_dir, initial_iter, is_training_action, vars_to_restore)