code: def restore(
      self, *, directory=None, filename=None, format="checkpoint"
  ):
      if format == "checkpoint":
          if directory is None:
              if self.saver is None:
                  raise TensorforceError.required(
                      name="Model.save", argument="directory"
                  )
              directory = self.saver_directory
          if filename is None:
              path = tf.train.latest_checkpoint(
                  checkpoint_dir=directory
              )
              if not path:
                  raise TensorforceError.exists_not(
                      name="Checkpoint", value=directory
                  )
              _directory, filename = os.path.split(path)
              assert _directory == directory
          super().restore(directory=directory, filename=filename)
  
      elif format == "saved-model":
          # TODO: Check memory/estimator/etc variables are not included!
          raise TensorforceError.value(
              name="Model.load", argument="format", value=format
          )
  
      # elif format == 'tensorflow':
      #     self.saver.restore(sess=self.session, save_path=path)
  
      elif format == "numpy":
          if directory is None:
              raise TensorforceError(
                  name="Model.load",
                  argument="directory",
                  condition='format is "numpy"',
              )
          if filename is None:
              raise TensorforceError(
                  name="Model.load",
                  argument="filename",
                  condition='format is "numpy"',
              )
          variables = np.load(
              file=(os.path.join(directory, filename) + ".npz")
          )
          for variable in self.saved_variables:
              assert variable.name[-2] == ":"
              if variable.name.startswith(self.name + "/"):
                  variable.assign(
                      value=variables[
                          variable.name[len(self.name) + 1 : -2]
                      ]
                  )
              else:
                  variable.assign(value=variables[variable.name[:-2]])
  
      elif format == "hdf5":
          if directory is None:
              raise TensorforceError(
                  name="Model.load",
                  argument="directory",
                  condition='format is "hdf5"',
              )
          if filename is None:
              raise TensorforceError(
                  name="Model.load",
                  argument="filename",
                  condition='format is "hdf5"',
              )
          path = os.path.join(directory, filename)
          if os.path.isfile(path + ".hdf5"):
              path = path + ".hdf5"
          else:
              path = path + ".h5"
          with h5py.File(name=path, mode="r") as filehandle:
              for variable in self.saved_variables:
                  assert variable.name[-2] == ":"
                  if variable.name.startswith(self.name + "/"):
                      variable.assign(
                          value=filehandle[
                              variable.name[len(self.name) + 1 : -2]
                          ]
                      )
                  else:
                      variable.assign(
                          value=filehandle[variable.name[:-2]]
                      )
  
      else:
          raise TensorforceError.value(
              name="Model.load", argument="format", value=format
          )
  
      timesteps, episodes, updates = self.reset()
      return (
          timesteps.numpy().item(),
          episodes.numpy().item(),
          updates.numpy().item(),
      )
  
imports: from collections import OrderedDict
  import logging
  import os
  import time
  import h5py
  import numpy
  import tensorflow
  from tensorforce import TensorforceError
  from tensorforce.core import ArrayDict, Module, SignatureDict, TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util, VariableDict
  from tensorforce.core.layers import Layer
label_desc: Use image node_id 22 for calling the Model obj's underlying member method code with example usage: obj.restore() and returns: timesteps,  episodes,  updates