19
19
import pytest
20
20
21
21
from sagemaker .tensorflow import TensorFlow
22
- from sagemaker .tensorflow .defaults import LATEST_SERVING_VERSION
22
+ from sagemaker .tensorflow .defaults import LATEST_VERSION
23
23
from sagemaker .utils import unique_name_from_base , sagemaker_timestamp
24
24
25
25
import tests .integ
41
41
42
42
43
43
@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
46
46
47
47
48
48
def test_mnist_with_checkpoint_config (
@@ -60,7 +60,7 @@ def test_mnist_with_checkpoint_config(
60
60
sagemaker_session = sagemaker_session ,
61
61
script_mode = True ,
62
62
framework_version = tf_full_version ,
63
- py_version = "py37" ,
63
+ py_version = py_version ,
64
64
metric_definitions = [{"Name" : "train:global_steps" , "Regex" : r"global_step\/sec:\s(.*)" }],
65
65
checkpoint_s3_uri = checkpoint_s3_uri ,
66
66
checkpoint_local_path = checkpoint_local_path ,
@@ -90,7 +90,7 @@ def test_mnist_with_checkpoint_config(
90
90
assert actual_training_checkpoint_config == expected_training_checkpoint_config
91
91
92
92
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 ):
94
94
with kms_utils .bucket_with_encryption (sagemaker_session , ROLE ) as (bucket_with_kms , kms_key ):
95
95
output_path = os .path .join (
96
96
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
104
104
train_instance_type = "ml.c5.xlarge" ,
105
105
sagemaker_session = sagemaker_session ,
106
106
script_mode = True ,
107
- framework_version = tf_serving_version ,
107
+ framework_version = tf_full_version ,
108
108
py_version = py_version ,
109
109
code_location = output_path ,
110
110
output_path = output_path ,
@@ -139,7 +139,7 @@ def test_mnist_distributed(sagemaker_session, instance_type, tf_full_version, py
139
139
train_instance_count = 2 ,
140
140
train_instance_type = instance_type ,
141
141
sagemaker_session = sagemaker_session ,
142
- py_version = "py37" ,
142
+ py_version = py_version ,
143
143
script_mode = True ,
144
144
framework_version = tf_full_version ,
145
145
distributions = PARAMETER_SERVER_DISTRIBUTION ,
@@ -163,11 +163,11 @@ def test_mnist_async(sagemaker_session, cpu_instance_type, tf_full_version, py_v
163
163
role = ROLE ,
164
164
train_instance_count = 1 ,
165
165
train_instance_type = "ml.c5.4xlarge" ,
166
- py_version = tests . integ . PYTHON_VERSION ,
166
+ py_version = py_version ,
167
167
sagemaker_session = sagemaker_session ,
168
168
script_mode = True ,
169
169
# testing py-sdk functionality, no need to run against all TF versions
170
- framework_version = LATEST_SERVING_VERSION ,
170
+ framework_version = tf_full_version ,
171
171
tags = TAGS ,
172
172
)
173
173
inputs = estimator .sagemaker_session .upload_data (
@@ -199,9 +199,7 @@ def test_mnist_async(sagemaker_session, cpu_instance_type, tf_full_version, py_v
199
199
_assert_model_name_match (sagemaker_session .sagemaker_client , endpoint_name , model_name )
200
200
201
201
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 ):
205
203
estimator = TensorFlow (
206
204
entry_point = "training.py" ,
207
205
source_dir = TFS_RESOURCE_PATH ,
@@ -211,7 +209,7 @@ def test_deploy_with_input_handlers(
211
209
py_version = py_version ,
212
210
sagemaker_session = sagemaker_session ,
213
211
script_mode = True ,
214
- framework_version = tf_serving_version ,
212
+ framework_version = tf_full_version ,
215
213
tags = TAGS ,
216
214
)
217
215
0 commit comments