code: def image_summary(predictions, targets, hparams):
      """Reshapes predictions and passes it to tensorboard.
  
      Args:
        predictions : The predicted image (logits).
        targets : The ground truth.
        hparams: model hparams.
  
      Returns:
        summary_proto: containing the summary images.
        weights: A Tensor of zeros of the same shape as predictions.
      """
      del hparams
      results = tf.cast(tf.argmax(predictions, axis=-1), tf.uint8)
      gold = tf.cast(targets, tf.uint8)
      summary1 = tf.summary.image("prediction", results, max_outputs=2)
      summary2 = tf.summary.image("data", gold, max_outputs=2)
      summary = tf.summary.merge([summary1, summary2])
      return summary, tf.zeros_like(predictions)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import modalities
  from tensor2tensor.utils import bleu_hook
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import rouge
  from tensor2tensor.utils import sari_hook
  import tensorflow.compat.v1
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 24 for calling a global function with example usage: image_summary(predictions, targets, hparams) and returns: summary,  tf