Skip to content

Commit a41b2b2

Browse files
icywang86ruiEliza Zhang
authored andcommitted
Use the test argement framework_version in all tests (aws#158)
* Use the test argement framework_version in all tests * Make flake8 happy
1 parent 23a9a61 commit a41b2b2

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

test/integration/local/test_keras.py

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -16,99 +16,42 @@
1616
import os
1717

1818
import numpy as np
19-
<<<<<<< HEAD
20-
<<<<<<< HEAD
21-
=======
22-
>>>>>>> Fix Keras test (#132)
2319
import pytest
2420
from sagemaker.tensorflow import serving, TensorFlow
2521

2622
from test.integration import RESOURCE_PATH
2723
from test.integration.utils import processor, py_version # noqa: F401
28-
=======
29-
from sagemaker.tensorflow import serving, TensorFlow
30-
31-
from test.integration import RESOURCE_PATH
32-
>>>>>>> Add Keras support (#126)
3324

3425

3526
logging.basicConfig(level=logging.DEBUG)
3627

3728

38-
<<<<<<< HEAD
39-
<<<<<<< HEAD
40-
<<<<<<< HEAD
4129
@pytest.mark.skip(reason="Serving part fails because of version mismatch.")
4230
def test_keras_training(sagemaker_local_session, docker_image, tmpdir, framework_version):
43-
=======
44-
def test_keras_training(sagemaker_local_session, docker_image, tmpdir):
45-
>>>>>>> Add Keras support (#126)
46-
=======
47-
@pytest.fixture
48-
def local_mode_instance_type(processor):
49-
instance_type = 'local' if processor == 'cpu' else 'local_gpu'
50-
return instance_type
51-
52-
53-
def test_keras_training(sagemaker_local_session, docker_image, tmpdir, local_mode_instance_type):
54-
>>>>>>> Fix Keras test (#132)
55-
=======
56-
@pytest.mark.skip_gpu
57-
def test_keras_training(sagemaker_local_session, docker_image, tmpdir):
58-
>>>>>>> Skip keras local mode test on gpu and use random port for serving in the test (#134)
5931
entry_point = os.path.join(RESOURCE_PATH, 'keras_inception.py')
6032
output_path = 'file://{}'.format(tmpdir)
6133

6234
estimator = TensorFlow(
6335
entry_point=entry_point,
6436
role='SageMakerRole',
6537
train_instance_count=1,
66-
<<<<<<< HEAD
67-
<<<<<<< HEAD
68-
train_instance_type='local',
69-
<<<<<<< HEAD
70-
<<<<<<< HEAD
71-
=======
72-
train_instance_type=local_mode_instance_type,
73-
>>>>>>> Fix Keras test (#132)
74-
=======
7538
train_instance_type='local',
76-
>>>>>>> Skip keras local mode test on gpu and use random port for serving in the test (#134)
7739
image_name=docker_image,
7840
sagemaker_session=sagemaker_local_session,
7941
model_dir='/opt/ml/model',
8042
output_path=output_path,
8143
framework_version=framework_version,
82-
=======
83-
=======
84-
image_name=docker_image,
85-
>>>>>>> Create parameter server in different thread (#129)
86-
sagemaker_session=sagemaker_local_session,
87-
model_dir='/opt/ml/model',
88-
output_path=output_path,
89-
framework_version='1.11.0',
90-
>>>>>>> Add Keras support (#126)
9144
py_version='py3')
9245

9346
estimator.fit()
9447

95-
<<<<<<< HEAD
96-
<<<<<<< HEAD
9748
model = serving.Model(model_data=output_path,
9849
role='SageMakerRole',
9950
framework_version=framework_version,
100-
=======
101-
model = serving.Model(model_data=output_path, role='SageMakerRole',
102-
=======
103-
model = serving.Model(model_data=output_path,
104-
role='SageMakerRole',
105-
>>>>>>> Create parameter server in different thread (#129)
106-
framework_version='1.11.0',
107-
>>>>>>> Add Keras support (#126)
10851
sagemaker_session=sagemaker_local_session)
10952

11053
predictor = model.deploy(initial_instance_count=1, instance_type='local')
11154

11255
assert predictor.predict(np.random.randn(4, 4, 4, 2) * 255)
11356

114-
predictor.delete_endpoint()
57+
predictor.delete_endpoint()

0 commit comments

Comments
 (0)