code: def load_checkpoint(path, instantiate_sess=True):
      """Builds graph, loads checkpoint, and returns wrapped model."""
      tf.logging.info("Loading checkpoint from %s", path)
      hparams = lib_hparams.load_hparams(path)
      model = build_graph(is_training=False, hparams=hparams)
      wmodel = lib_tfutil.WrappedModel(model, model.loss.graph, hparams)
      if not instantiate_sess:
          return wmodel
      with wmodel.graph.as_default():
          wmodel.sess = tf.Session()
          saver = tf.train.Saver()
          tf.logging.info("loading checkpoint %s", path)
          chkpt_path = os.path.join(path, "best_model.ckpt")
          saver.restore(wmodel.sess, chkpt_path)
      return wmodel
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  from magenta.models.coconet import lib_hparams
  from magenta.models.coconet import lib_tfutil
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: load_checkpoint(path, instantiate_sess) and returns: wmodel, wmodel