Skip to content

doc: Add ECR URI Estimator example #1688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/frameworks/tensorflow/using_tf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,28 @@ The following args are not permitted when using Script Mode:
Where the S3 url is a path to your training data within Amazon S3.
The constructor keyword arguments define how SageMaker runs your training script.

Specify a Docker image using an Estimator
-----------------------------------------

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>`__.

When specifying the image, you must use the ``image_name=''`` arg to replace the following arg:

- ``py_version=''``

You should still specify the ``framework_version=''`` arg because the SageMaker Python SDK accomodates for differences in the images based on the version.

The following example uses the ``image_name=''`` arg to specify the container image, Python version, and framework version.

.. code:: python

tf_estimator = TensorFlow(entry_point='tf-train.py',
role='SageMakerRole',
train_instance_count=1,
train_instance_type='ml.p2.xlarge',
image_name='763104351884.dkr.ecr.<region>.amazonaws.com/<framework>-<job type>:<framework version>-<cpu/gpu>-<python version>-ubuntu18.04',
script_mode=True)

For more information about the sagemaker.tensorflow.TensorFlow estimator, see `SageMaker TensorFlow Classes`_.

Call the fit Method
Expand Down