Skip to content

Commit 62c02fe

Browse files
author
Dan Choi
committed
address comments
1 parent 2a9ab73 commit 62c02fe

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

doc/using_mxnet.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ The return object should be one of the following:
703703
For versions 1.4 and higher:
704704
----------------------------
705705
- a tuple with two items: the response data and ``accept_type`` (the content type of the response data), or
706-
- the response data: (the content type of the response will be set to either the accept header in the initial request or a default)
706+
- the response data: (the content type of the response will be set to either the accept header in the initial request or default to application/json)
707707

708708
For versions 1.3 and lower:
709709
---------------------------

src/sagemaker/mxnet/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ With the SageMaker Python SDK, you can train and host MXNet models on Amazon Sag
66

77
Supported versions of MXNet: ``1.4.0``, ``1.3.0``, ``1.2.1``, ``1.1.0``, ``1.0.0``, ``0.12.1``.
88

9-
Supported versions of MXNet for Elastic Inference: ``1.3.0``, ``1.4.0``.
9+
Supported versions of MXNet for Elastic Inference: ``1.4.0``, ``1.3.0``.
1010

1111
For information about using MXNet with the SageMaker Python SDK, see https://sagemaker.readthedocs.io/en/stable/using_mxnet.html.
1212

@@ -15,7 +15,7 @@ SageMaker MXNet Containers
1515

1616
When training and deploying training scripts, SageMaker runs your Python script in a Docker container with several libraries installed. When creating the Estimator and calling deploy to create the SageMaker Endpoint, you can control the environment your script runs in.
1717

18-
SageMaker runs MXNet Estimator scripts in either Python 2.7 or Python 3.6. You can select the Python version by passing a ``py_version`` keyword arg to the MXNet Estimator constructor. Setting this to ``py2`` (the default) will cause your training script to be run on Python 2.7. Setting this to ``py3`` will cause your training script to be run on Python 3.5. This Python version applies to both the Training Job, created by fit, and the Endpoint, created by deploy.
18+
SageMaker runs MXNet scripts in either Python 2.7 or Python 3.6. You can select the Python version by passing a ``py_version`` keyword arg to the MXNet Estimator constructor. Setting this to ``py2`` (the default) will cause your training script to be run on Python 2.7. Setting this to ``py3`` will cause your training script to be run on Python 3.6. This Python version applies to both the Training Job, created by fit, and the Endpoint, created by deploy.
1919

2020
Your MXNet training script will be run on version 1.2.1 by default. (See below for how to choose a different version, and currently supported versions.) The decision to use the GPU or CPU version of MXNet is made by the ``train_instance_type``, set on the MXNet constructor. If you choose a GPU instance type, your training job will be run on a GPU version of MXNet. If you choose a CPU instance type, your training job will be run on a CPU version of MXNet. Similarly, when you call deploy, specifying a GPU or CPU deploy_instance_type, will control which MXNet build your Endpoint runs.
2121

tests/integ/test_mxnet_train.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def test_attach_deploy(mxnet_training_job, sagemaker_session):
5555
estimator = MXNet.attach(mxnet_training_job, sagemaker_session=sagemaker_session)
5656
predictor = estimator.deploy(1, 'ml.m4.xlarge', endpoint_name=endpoint_name)
5757
data = numpy.zeros(shape=(1, 1, 28, 28))
58-
predictor.predict(data)
58+
result = predictor.predict(data)
59+
assert result is not None
5960

6061

6162
def test_deploy_model(mxnet_training_job, sagemaker_session, mxnet_full_version):
@@ -71,7 +72,8 @@ def test_deploy_model(mxnet_training_job, sagemaker_session, mxnet_full_version)
7172
predictor = model.deploy(1, 'ml.m4.xlarge', endpoint_name=endpoint_name)
7273

7374
data = numpy.zeros(shape=(1, 1, 28, 28))
74-
predictor.predict(data)
75+
result = predictor.predict(data)
76+
assert result is not None
7577

7678
predictor.delete_model()
7779
with pytest.raises(Exception) as exception:
@@ -175,7 +177,8 @@ def test_deploy_model_with_accelerator(mxnet_training_job, sagemaker_session, ei
175177
predictor = model.deploy(1, 'ml.m4.xlarge', endpoint_name=endpoint_name, accelerator_type='ml.eia1.medium')
176178

177179
data = numpy.zeros(shape=(1, 1, 28, 28))
178-
predictor.predict(data)
180+
result = predictor.predict(data)
181+
assert result is not None
179182

180183

181184
def test_async_fit(sagemaker_session, mxnet_full_version):
@@ -206,7 +209,8 @@ def test_async_fit(sagemaker_session, mxnet_full_version):
206209
estimator = MXNet.attach(training_job_name=training_job_name, sagemaker_session=sagemaker_session)
207210
predictor = estimator.deploy(1, 'ml.m4.xlarge', endpoint_name=endpoint_name)
208211
data = numpy.zeros(shape=(1, 1, 28, 28))
209-
predictor.predict(data)
212+
result = predictor.predict(data)
213+
assert result is not None
210214

211215

212216
def test_failed_training_job(sagemaker_session, mxnet_full_version):

0 commit comments

Comments
 (0)