Skip to content

The sagemaker model object URI is over-written when calling the compile API  #1947

Closed

Description

@kkoppolu1

Describe the bug
The sagemaker Model object can be created by supplying the image_uri attribute. However, when the compile API is invoked on the object, the image URI gets over-written. The overwrite is happening at https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/model.py#L403.

To reproduce

  1. Create a sagemaker Model object like MXNetModel or PyTorchModel with an image_uri set.
  2. Invoke compile with target instance from the "ml" family (eg ml_c5).
  3. Inspect the image URI of the object.
    NOTE: If it is the same, it maybe because the value you chose is the same as the value being set. Try another value for the image_uri.

Expected behavior
When the model is created with a specific image_uri, it is expected that the model adheres to it and does not overwrite it.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): MXNet and PyTorch. Could impact other frameworks.
  • Framework version: MXNet: 1.7. PyTorch: 1.4
  • Python version: py3
  • CPU or GPU: CPU. Impacts GPU as well.
  • Custom Docker image (Y/N): N

Additional context
Add any other context about the problem here.

Activity

  1. ajaykarpur commented on Oct 8, 2020

    @ajaykarpur
    Contributor

    Thanks @kkoppolu1, this does indeed look like a bug. We'll have a fix out for this shortly.

    It actually appears that this is the intended behavior:

    assert (
    "{}.dkr.ecr.{}.amazonaws.com/sagemaker-neo-tensorflow:1.15.0-inf-py3".format(
    NEO_REGION_ACCOUNT, REGION
    )
    == model.image_uri

  2. ajaykarpur commented on Oct 8, 2020

    @ajaykarpur
    Contributor

    Also related: #1938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions