class_docstr: A ``FrameworkModel`` implementation for inference with TensorFlow Serving.
docstr: Initialize a Model.
  
  Args:
      model_data (str or PipelineVariable): The S3 location of a SageMaker model data
          ``.tar.gz`` file.
      role (str): An AWS IAM role (either name or full ARN). The Amazon
          SageMaker training jobs and APIs that create Amazon SageMaker
          endpoints use this role to access training data and model
          artifacts. After the endpoint is created, the inference code
          might use the IAM role, if it needs to access an AWS resource.
      entry_point (str): Path (absolute or relative) to the Python source
          file which should be executed as the entry point to model
          hosting. If ``source_dir`` is specified, then ``entry_point``
          must point to a file located at the root of ``source_dir``.
      image_uri (str or PipelineVariable): A Docker image URI (default: None).
          If not specified, a default image for TensorFlow Serving will be used.
          If ``framework_version`` is ``None``, then ``image_uri`` is required.
          If ``image_uri`` is also ``None``, then a ``ValueError``
          will be raised.
      framework_version (str): Optional. TensorFlow Serving version you
          want to use. Defaults to ``None``. Required unless ``image_uri`` is
          provided.
      container_log_level (int): Log level to use within the container
          (default: logging.ERROR). Valid values are defined in the Python
          logging module.
      predictor_cls (callable[str, sagemaker.session.Session]): A function
          to call to create a predictor with an endpoint name and
          SageMaker ``Session``. If specified, ``deploy()`` returns the
          result of invoking this function on the created endpoint name.
      **kwargs: Keyword arguments passed to the superclass
          :class:`~sagemaker.model.FrameworkModel` and, subsequently, its
          superclass :class:`~sagemaker.model.Model`.
  
  .. tip::
  
      You can find additional parameters for initializing this class at
      :class:`~sagemaker.model.FrameworkModel` and
      :class:`~sagemaker.model.Model`.
docstr_tok: ["Initialize","a","Model",".","Args",":","model_data","(","str","or","PipelineVariable",")",":","The","S3","location","of","a","SageMaker","model","data","``",".tar.gz","``","file",".","role","(","str",")",":","An","AWS","IAM","role","(","either","name","or","full","ARN",")",".","The","Amazon","SageMaker","training","jobs","and","APIs","that","create","Amazon","SageMaker","endpoints","use","this","role","to","access","training","data","and","model","artifacts",".","After","the","endpoint","is","created",",","the","inference","code","might","use","the","IAM","role",",","if","it","needs","to","access","an","AWS","resource",".","entry_point","(","str",")",":","Path","(","absolute","or","relative",")","to","the","Python","source","file","which","should","be","executed","as","the","entry","point","to","model","hosting",".","If","``","source_dir","``","is","specified",",","then","``","entry_point","``","must","point","to","a","file","located","at","the","root","of","``","source_dir","``",".","image_uri","(","str","or","PipelineVariable",")",":","A","Docker","image","URI","(","default",":","None",")",".","If","not","specified",",","a","default","image","for","TensorFlow","Serving","will","be","used",".","If","``","framework_version","``","is","``","None","``",",","then","``","image_uri","``","is","required",".","If","``","image_uri","``","is","also","``","None","``",",","then","a","``","ValueError","``","will","be","raised",".","framework_version","(","str",")",":","Optional",".","TensorFlow","Serving","version","you","want","to","use",".","Defaults","to","``","None","``",".","Required","unless","``","image_uri","``","is","provided",".","container_log_level","(","int",")",":","Log","level","to","use","within","the","container","(","default",":","logging.ERROR",")",".","Valid","values","are","defined","in","the","Python","logging","module",".","predictor_cls","(","callable","[","str",",","sagemaker.session.Session","]",")",":","A","function","to","call","to","create","a","predictor","with","an","endpoint","name","and","SageMaker","``","Session","``",".","If","specified",",","``","deploy","(",")","``","returns","the","result","of","invoking","this","function","on","the","created","endpoint","name",".","*","*","kwargs",":","Keyword","arguments","passed","to","the","superclass",":","class",":","`","~sagemaker.model.FrameworkModel","`","and",",","subsequently",",","its","superclass",":","class",":","`","~sagemaker.model.Model","`",".","..","tip",":",":","You","can","find","additional","parameters","for","initializing","this","class","at",":","class",":","`","~sagemaker.model.FrameworkModel","`","and",":","class",":","`","~sagemaker.model.Model","`","."]
code: def __init__(
      self,
      model_data: Union[str, PipelineVariable],
      role: str = None,
      entry_point: Optional[str] = None,
      image_uri: Optional[Union[str, PipelineVariable]] = None,
      framework_version: Optional[str] = None,
      container_log_level: Optional[int] = None,
      predictor_cls: callable = TensorFlowPredictor,
      **kwargs,
  ):
      """Initialize a Model.
  
      Args:
          model_data (str or PipelineVariable): The S3 location of a SageMaker model data
              ``.tar.gz`` file.
          role (str): An AWS IAM role (either name or full ARN). The Amazon
              SageMaker training jobs and APIs that create Amazon SageMaker
              endpoints use this role to access training data and model
              artifacts. After the endpoint is created, the inference code
              might use the IAM role, if it needs to access an AWS resource.
          entry_point (str): Path (absolute or relative) to the Python source
              file which should be executed as the entry point to model
              hosting. If ``source_dir`` is specified, then ``entry_point``
              must point to a file located at the root of ``source_dir``.
          image_uri (str or PipelineVariable): A Docker image URI (default: None).
              If not specified, a default image for TensorFlow Serving will be used.
              If ``framework_version`` is ``None``, then ``image_uri`` is required.
              If ``image_uri`` is also ``None``, then a ``ValueError``
              will be raised.
          framework_version (str): Optional. TensorFlow Serving version you
              want to use. Defaults to ``None``. Required unless ``image_uri`` is
              provided.
          container_log_level (int): Log level to use within the container
              (default: logging.ERROR). Valid values are defined in the Python
              logging module.
          predictor_cls (callable[str, sagemaker.session.Session]): A function
              to call to create a predictor with an endpoint name and
              SageMaker ``Session``. If specified, ``deploy()`` returns the
              result of invoking this function on the created endpoint name.
          **kwargs: Keyword arguments passed to the superclass
              :class:`~sagemaker.model.FrameworkModel` and, subsequently, its
              superclass :class:`~sagemaker.model.Model`.
  
      .. tip::
  
          You can find additional parameters for initializing this class at
          :class:`~sagemaker.model.FrameworkModel` and
          :class:`~sagemaker.model.Model`.
      """
      if framework_version is None and image_uri is None:
          raise ValueError(
              "Both framework_version and image_uri were None. "
              "Either specify framework_version or specify image_uri."
          )
      self.framework_version = framework_version
  
      # Inference framework version is being introduced to accomodate the mismatch between
      # tensorflow and tensorflow serving releases, wherein the TF and TFS might have different
      # patch versions, but end up hosting the model of same TF version. For eg., the upstream
      # TFS-2.12.0 release was a bad release and hence a new TFS-2.12.1 release was made to host
      # models from TF-2.12.0.
      training_inference_version_mismatch_dict = {"2.12.0": "2.12.1"}
      self.inference_framework_version = (
          training_inference_version_mismatch_dict.get(
              framework_version, framework_version
          )
      )
      super(TensorFlowModel, self).__init__(
          model_data=model_data,
          role=role,
          image_uri=image_uri,
          predictor_cls=predictor_cls,
          entry_point=entry_point,
          **kwargs,
      )
      self._container_log_level = container_log_level
  
imports: from __future__ import absolute_import
  import logging
  from typing import Union, Optional, List, Dict
  import sagemaker
  from sagemaker import image_uris, s3, ModelMetrics
  from sagemaker.deserializers import JSONDeserializer
  from sagemaker.deprecations import removed_kwargs
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import JSONSerializer
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.workflow.pipeline_context import PipelineSession
  from sagemaker.utils import format_tags
label_desc: Use image node_id 1 to create a new TensorFlowModel object from inherited base classes: sagemaker.model with example: obj = TensorFlowModel(model_data, role, entry_point, image_uri, framework_version, container_log_level, predictor_cls)