Image URIs

Functions for generating ECR image URIs for pre-built SageMaker Docker images.

sagemaker.image_uris.retrieve(framework, region, version=None, py_version=None, instance_type=None, accelerator_type=None, image_scope=None, container_version=None, distribution=None, base_framework_version=None)

Retrieves the ECR URI for the Docker image matching the given arguments.

Ideally this function should not be called directly, rather it should be called from the fit() function inside framework estimator.

Parameters
  • framework (str) – The name of the framework or algorithm.

  • region (str) – The AWS region.

  • version (str) – The framework or algorithm version. This is required if there is more than one supported version for the given framework or algorithm.

  • py_version (str) – The Python version. This is required if there is more than one supported Python version for the given framework version.

  • instance_type (str) – The SageMaker instance type. For supported types, see https://aws.amazon.com/sagemaker/pricing/instance-types. This is required if there are different images for different processor types.

  • accelerator_type (str) – Elastic Inference accelerator type. For more, see https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html.

  • image_scope (str) – The image type, i.e. what it is used for. Valid values: “training”, “inference”, “eia”. If accelerator_type is set, image_scope is ignored.

  • container_version (str) – the version of docker image. Ideally the value of parameter should be created inside the framework. For custom use, see the list of supported container versions: https://github.com/aws/deep-learning-containers/blob/master/available_images.md (default: None).

  • distribution (dict) – A dictionary with information on how to run distributed training (default: None).

Returns

the ECR URI for the corresponding SageMaker Docker image.

Return type

str

Raises

ValueError – If the combination of arguments specified is not supported.

sagemaker.image_uris.config_for_framework(framework)

Loads the JSON config for the given framework.