Skip to content

Commit 6cdc977

Browse files
authored
doc: Add ECR URI Estimator example (#1688)
1 parent e09ac60 commit 6cdc977

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/frameworks/tensorflow/using_tf.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,28 @@ The following args are not permitted when using Script Mode:
197197
Where the S3 url is a path to your training data within Amazon S3.
198198
The constructor keyword arguments define how SageMaker runs your training script.
199199

200+
Specify a Docker image using an Estimator
201+
-----------------------------------------
202+
203+
There are use cases, such as extending an existing pre-built Amazon SageMaker images, that require specifing a Docker image when creating an Estimator by directly specifying the ECR URI instead of the Python and framework version. For a full list of available container URIs, see `Available Deep Learning Containers Images <https://github.com/aws/deep-learning-containers/blob/master/available_images.md>`__ For more information on using Docker containers, see `Use Your Own Algorithms or Models with Amazon SageMaker <https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html>`__.
204+
205+
When specifying the image, you must use the ``image_name=''`` arg to replace the following arg:
206+
207+
- ``py_version=''``
208+
209+
You should still specify the ``framework_version=''`` arg because the SageMaker Python SDK accomodates for differences in the images based on the version.
210+
211+
The following example uses the ``image_name=''`` arg to specify the container image, Python version, and framework version.
212+
213+
.. code:: python
214+
215+
tf_estimator = TensorFlow(entry_point='tf-train.py',
216+
role='SageMakerRole',
217+
train_instance_count=1,
218+
train_instance_type='ml.p2.xlarge',
219+
image_name='763104351884.dkr.ecr.<region>.amazonaws.com/<framework>-<job type>:<framework version>-<cpu/gpu>-<python version>-ubuntu18.04',
220+
script_mode=True)
221+
200222
For more information about the sagemaker.tensorflow.TensorFlow estimator, see `SageMaker TensorFlow Classes`_.
201223

202224
Call the fit Method

0 commit comments

Comments
 (0)