docstr: TFPredictor takes a list of TensorFlow tensors as the model outputs and
  feed all the elements in TFDatasets to produce those outputs and returns
  a Spark RDD with each of its elements representing the model prediction
  for the corresponding input elements.
  
  :param sess: the current TensorFlow Session, you should first use this session
  to load the trained variables then pass into TFPredictor
  :param outputs: the output tensors of the TensorFlow model
docstr_tok: ["TFPredictor","takes","a","list","of","TensorFlow","tensors","as","the","model","outputs","and","feed","all","the","elements","in","TFDatasets","to","produce","those","outputs","and","returns","a","Spark","RDD","with","each","of","its","elements","representing","the","model","prediction","for","the","corresponding","input","elements",".",":","param","sess",":","the","current","TensorFlow","Session",",","you","should","first","use","this","session","to","load","the","trained","variables","then","pass","into","TFPredictor",":","param","outputs",":","the","output","tensors","of","the","TensorFlow","model"]
code: def __init__(self, sess, outputs, inputs=None, dataset=None):
      """
      TFPredictor takes a list of TensorFlow tensors as the model outputs and
      feed all the elements in TFDatasets to produce those outputs and returns
      a Spark RDD with each of its elements representing the model prediction
      for the corresponding input elements.
  
      :param sess: the current TensorFlow Session, you should first use this session
      to load the trained variables then pass into TFPredictor
      :param outputs: the output tensors of the TensorFlow model
      """
      if inputs is None:
          dataset, inputs = TFPredictor._get_datasets_and_inputs(
              outputs
          )
  
      self.sess = sess
      self.dataset = dataset
      self.inputs = inputs
      self.tfnet = TFNet.from_session(sess, self.inputs, outputs)
      if self.dataset.batch_per_thread <= 0:
          raise ValueError(
              "You should set batch_per_thread on TFDataset "
              + "instead of batch_size for prediction"
          )
  
file_path: analytics-zoo/pyzoo/zoo/tfpark/tf_predictor.py
imports: import sys
  from zoo.pipeline.api.net.utils import find_placeholders, _check_the_same
  from zoo.tfpark.tfnet import TFNet
  from zoo.tfpark.tf_dataset import TFNdarrayDataset, check_data_compatible
  from zoo.tfpark.tf_dataset import _standarize_feature_dataset
label_desc: Use image node_id 1 to create a new TFPredictor object  with example: obj = TFPredictor(sess, outputs, inputs, dataset)