Skip to content

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

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

Closed
kkoppolu1 opened this issue Oct 8, 2020 · 3 comments
Closed

Comments

@kkoppolu1
Copy link

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.

@ajaykarpur
Copy link
Contributor

ajaykarpur commented Oct 8, 2020

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

@ajaykarpur
Copy link
Contributor

ajaykarpur commented Oct 8, 2020

@ajaykarpur
Copy link
Contributor

Also related: #1938

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

No branches or pull requests

3 participants