Skip to content

Commit 7ee405a

Browse files
committed
fix: updates based on pr feedback
1 parent 210247c commit 7ee405a

File tree

2 files changed

+3
-60
lines changed

2 files changed

+3
-60
lines changed

tests/conftest.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def xgboost_version(request):
209209
"1.11.0",
210210
"1.12",
211211
"1.12.0",
212+
"1.13",
212213
"1.14",
213214
"1.14.0",
214215
"1.15",
@@ -228,7 +229,7 @@ def tf_version(request):
228229
@pytest.fixture(scope="module", params=["py2", "py3"])
229230
def tf_py_version(tf_version, request):
230231
version = [int(val) for val in tf_version.split(".")]
231-
if version < [1, 13]:
232+
if version < [1, 11]:
232233
return "py2"
233234
if version < [2, 2]:
234235
return request.param
@@ -309,7 +310,7 @@ def tf_full_py_version(tf_full_version, request):
309310
TODO: Evaluate use of --tf-full-version with possible eye to remove and simplify code.
310311
"""
311312
version = [int(val) for val in tf_full_version.split(".")]
312-
if version < [1, 13]:
313+
if version < [1, 11]:
313314
return "py2"
314315
if tf_full_version in [TensorFlow._LATEST_1X_VERSION, LATEST_VERSION]:
315316
return "py37"

tests/integ/test_tuner.py

-58
Original file line numberDiff line numberDiff line change
@@ -633,64 +633,6 @@ def test_tuning_tf_script_mode(
633633
tuner.wait()
634634

635635

636-
# TODO: evaluate skip mark and default framework_version 1.11
637-
@pytest.mark.canary_quick
638-
@pytest.mark.skipif(PYTHON_VERSION != "py2", reason="TensorFlow image supports only python 2.")
639-
def test_tuning_tf(sagemaker_session, cpu_instance_type):
640-
with timeout(minutes=TUNING_DEFAULT_TIMEOUT_MINUTES):
641-
script_path = os.path.join(DATA_DIR, "iris", "iris-dnn-classifier.py")
642-
643-
estimator = TensorFlow(
644-
entry_point=script_path,
645-
role="SageMakerRole",
646-
training_steps=1,
647-
evaluation_steps=1,
648-
hyperparameters={"input_tensor_name": "inputs"},
649-
train_instance_count=1,
650-
train_instance_type=cpu_instance_type,
651-
sagemaker_session=sagemaker_session,
652-
framework_version="1.11",
653-
py_version=PYTHON_VERSION,
654-
)
655-
656-
inputs = sagemaker_session.upload_data(path=DATA_PATH, key_prefix="integ-test-data/tf_iris")
657-
hyperparameter_ranges = {"learning_rate": ContinuousParameter(0.05, 0.2)}
658-
659-
objective_metric_name = "loss"
660-
metric_definitions = [{"Name": "loss", "Regex": "loss = ([0-9\\.]+)"}]
661-
662-
tuner = HyperparameterTuner(
663-
estimator,
664-
objective_metric_name,
665-
hyperparameter_ranges,
666-
metric_definitions,
667-
objective_type="Minimize",
668-
max_jobs=2,
669-
max_parallel_jobs=2,
670-
)
671-
672-
tuning_job_name = unique_name_from_base("tune-tf", max_length=32)
673-
tuner.fit(inputs, job_name=tuning_job_name)
674-
675-
print("Started hyperparameter tuning job with name:" + tuning_job_name)
676-
677-
time.sleep(15)
678-
tuner.wait()
679-
680-
best_training_job = tuner.best_training_job()
681-
with timeout_and_delete_endpoint_by_name(best_training_job, sagemaker_session):
682-
predictor = tuner.deploy(1, cpu_instance_type)
683-
684-
features = [6.4, 3.2, 4.5, 1.5]
685-
dict_result = predictor.predict({"inputs": features})
686-
print("predict result: {}".format(dict_result))
687-
list_result = predictor.predict(features)
688-
print("predict result: {}".format(list_result))
689-
690-
assert dict_result == list_result
691-
692-
693-
# TODO: evaluate skip mark and default framework_version 1.11
694636
@pytest.mark.skipif(PYTHON_VERSION != "py2", reason="TensorFlow image supports only python 2.")
695637
def test_tuning_tf_vpc_multi(sagemaker_session, cpu_instance_type):
696638
"""Test Tensorflow multi-instance using the same VpcConfig for training and inference"""

0 commit comments

Comments
 (0)