class_docstr: Simple wrapper of the public image models with session object.
class_docstr_tok: ["Simple","wrapper","of","the","public","image","models","with","session","object","."]
code: def __init__(
      self,
      sess,
      model_fn_path,
      labels_path,
      image_shape,
      endpoints_dict,
      scope,
  ):
      super(PublicImageModelWrapper, self).__init__(image_shape)
      self.labels = tf.io.gfile.GFile(labels_path).read().splitlines()
      self.ends = PublicImageModelWrapper.import_graph(
          model_fn_path,
          endpoints_dict,
          self.image_value_range,
          scope=scope,
      )
      self.bottlenecks_tensors = (
          PublicImageModelWrapper.get_bottleneck_tensors(scope)
      )
      graph = tf.compat.v1.get_default_graph()
  
      # Construct gradient ops.
      with graph.as_default():
          self.y_input = tf.compat.v1.placeholder(
              tf.int64, shape=[None]
          )
  
          self.pred = tf.expand_dims(self.ends["prediction"][0], 0)
          self.loss = tf.reduce_mean(
              input_tensor=tf.compat.v1.nn.softmax_cross_entropy_with_logits_v2(
                  labels=tf.one_hot(
                      self.y_input,
                      self.ends["prediction"].get_shape().as_list()[1],
                  ),
                  logits=self.pred,
              )
          )
      self._make_gradient_tensors()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from abc import ABCMeta
  from abc import abstractmethod
  from six.moves import zip
  import numpy
  import six
  import tensorflow
  from google.protobuf import text_format
label_desc: Use image node_id 1 to create a new PublicImageModelWrapper object from inherited base classes: ImageModelWrapper with example: obj = PublicImageModelWrapper(sess, model_fn_path, labels_path, image_shape, endpoints_dict, scope)