diff --git a/src/sagemaker/image_uri_config/tensorflow.json b/src/sagemaker/image_uri_config/tensorflow.json index b2250f6a39..20d2f79aa6 100644 --- a/src/sagemaker/image_uri_config/tensorflow.json +++ b/src/sagemaker/image_uri_config/tensorflow.json @@ -320,7 +320,8 @@ "2.8": "2.8.4", "2.9": "2.9.3", "2.10": "2.10.1", - "2.11": "2.11.0" + "2.11": "2.11.1", + "2.12": "2.12.1" }, "versions": { "1.10.0": { @@ -1938,6 +1939,80 @@ "us-west-2": "763104351884" }, "repository": "tensorflow-inference" + }, + "2.11.1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ca-central-1": "763104351884", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "me-south-1": "217643126080", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-iso-east-1": "886529160074", + "us-isob-east-1": "094389454867", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "tensorflow-inference" + }, + "2.12.1": { + "registries": { + "af-south-1": "626614931356", + "ap-east-1": "871362719292", + "ap-northeast-1": "763104351884", + "ap-northeast-2": "763104351884", + "ap-northeast-3": "364406365360", + "ap-south-1": "763104351884", + "ap-south-2": "772153158452", + "ap-southeast-1": "763104351884", + "ap-southeast-2": "763104351884", + "ap-southeast-3": "907027046896", + "ap-southeast-4": "457447274322", + "ca-central-1": "763104351884", + "cn-north-1": "727897471807", + "cn-northwest-1": "727897471807", + "eu-central-1": "763104351884", + "eu-central-2": "380420809688", + "eu-north-1": "763104351884", + "eu-south-1": "692866216735", + "eu-south-2": "503227376785", + "eu-west-1": "763104351884", + "eu-west-2": "763104351884", + "eu-west-3": "763104351884", + "me-south-1": "217643126080", + "sa-east-1": "763104351884", + "us-east-1": "763104351884", + "us-east-2": "763104351884", + "us-gov-east-1": "446045086412", + "us-gov-west-1": "442386744353", + "us-iso-east-1": "886529160074", + "us-isob-east-1": "094389454867", + "us-west-1": "763104351884", + "us-west-2": "763104351884" + }, + "repository": "tensorflow-inference" } } }, diff --git a/src/sagemaker/tensorflow/model.py b/src/sagemaker/tensorflow/model.py index d893cf0762..705b7667dd 100644 --- a/src/sagemaker/tensorflow/model.py +++ b/src/sagemaker/tensorflow/model.py @@ -185,6 +185,16 @@ def __init__( ) 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, @@ -463,7 +473,7 @@ def _get_image_uri( return image_uris.retrieve( self._framework_name, region_name or self.sagemaker_session.boto_region_name, - version=self.framework_version, + version=self.inference_framework_version, instance_type=instance_type, accelerator_type=accelerator_type, image_scope="inference", diff --git a/tests/conftest.py b/tests/conftest.py index f9429279a3..8413cd4520 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -528,7 +528,9 @@ def tf_full_py_version(tf_full_version): return "py37" if version < Version("2.8"): return "py38" - return "py39" + if version < Version("2.12"): + return "py39" + return "py310" @pytest.fixture(scope="module")