docstr: Create a TFNet from an TensorFlow saved model
  :param model_path: the path to the SavedModel path
  :param tag: the tag to load in the saved model, default to "serve"
  :param signature: The signature of the SignatureDef that defines inputs
                    and outputs of the graph. TFNet assumes inputs is sorted
                    by their corresponding key in SignatureDef.
  :param inputs: a list input tensor names of this model, you may want to use TensorFlow's
                command line tool to inspect the saved model to find the input tensor
                names e.g. `saved_model_cli show --dir {saved_model_path} --all`
  :param outputs: a list output tensor names of this model, you may want to use TensorFlow's
                command line tool to inspect the saved model to find the output tensor
                names e.g. `saved_model_cli show --dir {saved_model_path} --all`
  :param tf_session_config: an optional tf.ConfigProto object to
                 set the session config in java side.
                 This config does not necessarily be the same with your current session.
                 E.g. sess_config = tf.ConfigProto(inter_op_parallelism_threads=1,
                                                   intra_op_parallelism_threads=1)
                      net = TFNet.from_session(sess, inputs, outputs, sess_config)
  :return: a TFNet
docstr_tok: ["Create","a","TFNet","from","an","TensorFlow","saved","model",":","param","model_path",":","the","path","to","the","SavedModel","path",":","param","tag",":","the","tag","to","load","in","the","saved","model",",","default","to","``","serve","''",":","param","signature",":","The","signature","of","the","SignatureDef","that","defines","inputs","and","outputs","of","the","graph",".","TFNet","assumes","inputs","is","sorted","by","their","corresponding","key","in","SignatureDef",".",":","param","inputs",":","a","list","input","tensor","names","of","this","model",",","you","may","want","to","use","TensorFlow's","command","line","tool","to","inspect","the","saved","model","to","find","the","input","tensor","names","e.g",".","`","saved_model_cli","show","--","dir","{","saved_model_path","}","--","all","`",":","param","outputs",":","a","list","output","tensor","names","of","this","model",",","you","may","want","to","use","TensorFlow's","command","line","tool","to","inspect","the","saved","model","to","find","the","output","tensor","names","e.g",".","`","saved_model_cli","show","--","dir","{","saved_model_path","}","--","all","`",":","param","tf_session_config",":","an","optional","tf.ConfigProto","object","to","set","the","session","config","in","java","side",".","This","config","does","not","necessarily","be","the","same","with","your","current","session",".","E.g",".","sess_config","=","tf.ConfigProto","(","inter_op_parallelism_threads=1",",","intra_op_parallelism_threads=1",")","net","=","TFNet.from_session","(","sess",",","inputs",",","outputs",",","sess_config",")",":","return",":","a","TFNet"]
code: def from_saved_model(
      model_path,
      tag=None,
      signature=None,
      inputs=None,
      outputs=None,
      tf_session_config=None,
      init_op=None,
  ):
      """
      Create a TFNet from an TensorFlow saved model
      :param model_path: the path to the SavedModel path
      :param tag: the tag to load in the saved model, default to "serve"
      :param signature: The signature of the SignatureDef that defines inputs
                        and outputs of the graph. TFNet assumes inputs is sorted
                        by their corresponding key in SignatureDef.
      :param inputs: a list input tensor names of this model, you may want to use TensorFlow's
                    command line tool to inspect the saved model to find the input tensor
                    names e.g. `saved_model_cli show --dir {saved_model_path} --all`
      :param outputs: a list output tensor names of this model, you may want to use TensorFlow's
                    command line tool to inspect the saved model to find the output tensor
                    names e.g. `saved_model_cli show --dir {saved_model_path} --all`
      :param tf_session_config: an optional tf.ConfigProto object to
                     set the session config in java side.
                     This config does not necessarily be the same with your current session.
                     E.g. sess_config = tf.ConfigProto(inter_op_parallelism_threads=1,
                                                       intra_op_parallelism_threads=1)
                          net = TFNet.from_session(sess, inputs, outputs, sess_config)
      :return: a TFNet
      """
      config_bytes = None
      if tf_session_config is not None:
          import tensorflow as tf
  
          invalidInputError(
              isinstance(tf_session_config, tf.ConfigProto),
              "expect tf_session_config is tf.ConfigProto type",
          )
          tf_session_config.use_per_session_threads = True
          config_bytes = bytearray(
              tf_session_config.SerializeToString()
          )
  
      if inputs is None or outputs is None:
          jvalue = callZooFunc(
              "float",
              "createTFNetFromSavedModel",
              model_path,
              tag,
              signature,
              config_bytes,
          )
      else:
          jvalue = callZooFunc(
              "float",
              "createTFNetFromSavedModel",
              model_path,
              tag,
              inputs,
              outputs,
              config_bytes,
              init_op,
          )
      return TFNet(path=None, jvalue=jvalue)
  
imports: import os
  import sys
  import tempfile
  import numpy
  import six
  from pyspark import RDD
  from bigdl.dllib.nn.layer import Layer
  from bigdl.dllib.utils.file_utils import JTensor
  from bigdl.dllib.nncontext import getOrCreateSparkContext
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.feature.image import ImageSet
  from bigdl.orca.tfpark.tf_dataset import TFImageDataset, TFDataset
  import logging
  from bigdl.dllib.utils.utils import to_sample_rdd
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 6 for calling the TFNet obj's underlying member method code with example usage: obj.from_saved_model(model_path, tag, signature, inputs, outputs, tf_session_config, init_op) and returns: TFNet