1919import pytest
2020
2121from sagemaker .tensorflow import TensorFlow
22- from sagemaker .tensorflow .defaults import LATEST_SERVING_VERSION
22+ from sagemaker .tensorflow .defaults import LATEST_VERSION
2323from sagemaker .utils import unique_name_from_base , sagemaker_timestamp
2424
2525import tests .integ
4141
4242
4343@pytest .fixture (scope = "module" )
44- def py_version (tf_full_version , tf_serving_version ):
45- return "py37" if tf_full_version == tf_serving_version else tests .integ .PYTHON_VERSION
44+ def py_version (tf_full_version ):
45+ return "py37" if tf_full_version == LATEST_VERSION else tests .integ .PYTHON_VERSION
4646
4747
4848def test_mnist_with_checkpoint_config (
@@ -60,7 +60,7 @@ def test_mnist_with_checkpoint_config(
6060 sagemaker_session = sagemaker_session ,
6161 script_mode = True ,
6262 framework_version = tf_full_version ,
63- py_version = "py37" ,
63+ py_version = py_version ,
6464 metric_definitions = [{"Name" : "train:global_steps" , "Regex" : r"global_step\/sec:\s(.*)" }],
6565 checkpoint_s3_uri = checkpoint_s3_uri ,
6666 checkpoint_local_path = checkpoint_local_path ,
@@ -90,7 +90,7 @@ def test_mnist_with_checkpoint_config(
9090 assert actual_training_checkpoint_config == expected_training_checkpoint_config
9191
9292
93- def test_server_side_encryption (sagemaker_session , tf_serving_version , py_version ):
93+ def test_server_side_encryption (sagemaker_session , tf_full_version , py_version ):
9494 with kms_utils .bucket_with_encryption (sagemaker_session , ROLE ) as (bucket_with_kms , kms_key ):
9595 output_path = os .path .join (
9696 bucket_with_kms , "test-server-side-encryption" , time .strftime ("%y%m%d-%H%M" )
@@ -104,7 +104,7 @@ def test_server_side_encryption(sagemaker_session, tf_serving_version, py_versio
104104 train_instance_type = "ml.c5.xlarge" ,
105105 sagemaker_session = sagemaker_session ,
106106 script_mode = True ,
107- framework_version = tf_serving_version ,
107+ framework_version = tf_full_version ,
108108 py_version = py_version ,
109109 code_location = output_path ,
110110 output_path = output_path ,
@@ -139,7 +139,7 @@ def test_mnist_distributed(sagemaker_session, instance_type, tf_full_version, py
139139 train_instance_count = 2 ,
140140 train_instance_type = instance_type ,
141141 sagemaker_session = sagemaker_session ,
142- py_version = "py37" ,
142+ py_version = py_version ,
143143 script_mode = True ,
144144 framework_version = tf_full_version ,
145145 distributions = PARAMETER_SERVER_DISTRIBUTION ,
@@ -163,11 +163,11 @@ def test_mnist_async(sagemaker_session, cpu_instance_type, tf_full_version, py_v
163163 role = ROLE ,
164164 train_instance_count = 1 ,
165165 train_instance_type = "ml.c5.4xlarge" ,
166- py_version = tests . integ . PYTHON_VERSION ,
166+ py_version = py_version ,
167167 sagemaker_session = sagemaker_session ,
168168 script_mode = True ,
169169 # testing py-sdk functionality, no need to run against all TF versions
170- framework_version = LATEST_SERVING_VERSION ,
170+ framework_version = tf_full_version ,
171171 tags = TAGS ,
172172 )
173173 inputs = estimator .sagemaker_session .upload_data (
@@ -199,9 +199,7 @@ def test_mnist_async(sagemaker_session, cpu_instance_type, tf_full_version, py_v
199199 _assert_model_name_match (sagemaker_session .sagemaker_client , endpoint_name , model_name )
200200
201201
202- def test_deploy_with_input_handlers (
203- sagemaker_session , instance_type , tf_serving_version , py_version
204- ):
202+ def test_deploy_with_input_handlers (sagemaker_session , instance_type , tf_full_version , py_version ):
205203 estimator = TensorFlow (
206204 entry_point = "training.py" ,
207205 source_dir = TFS_RESOURCE_PATH ,
@@ -211,7 +209,7 @@ def test_deploy_with_input_handlers(
211209 py_version = py_version ,
212210 sagemaker_session = sagemaker_session ,
213211 script_mode = True ,
214- framework_version = tf_serving_version ,
212+ framework_version = tf_full_version ,
215213 tags = TAGS ,
216214 )
217215
0 commit comments