Skip to content

Exception: instance_type should not be a pipeline variable (<class 'sagemaker.workflow.parameters.ParameterString'>) #3141

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
qidewenwhen opened this issue May 27, 2022 · 1 comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug

Comments

@qidewenwhen
Copy link
Member

qidewenwhen commented May 27, 2022

Describe the bug
After the release https://github.com/aws/sagemaker-python-sdk/releases/tag/v2.92.0, pipelines which was working before started failing with this exception, which relates to this commit

Exception: instance_type should not be a pipeline variable (<class 'sagemaker.workflow.parameters.ParameterString'>)

Note
This is a breaking change which can break some existing customer codes, so open this issue, post the explanation and fix options here, in case any one searches for it.

@qidewenwhen qidewenwhen added type: bug component: pipelines Relates to the SageMaker Pipeline Platform labels May 27, 2022
@qidewenwhen
Copy link
Member Author

The reason for the breaking change
The error is thrown when we pass in any kind of pipeline variables e.g. Parameter, Properties etc. to the image_uris.retrieve()
The pipeline variables are placeholders which are parsed in execution time but the image_uris.retrieve()is retrieving image_uris in compile time (PySDK stage). In other words, the parameterization here won't work at all. And we have received several internal/external customers complaining on this e.g. GitHub issue.
Thus we decided to explicitly forbid passing in any pipeline variables to image_uris.retrieve().

To resolve this issue

  • If you directly put any pipeline variables to image_uris.retrieve(), please replace them with python primitives e.g. plain string
  • If you see this error thrown from any estimator/processor, that's because image_uri is not provided (i.e. None) here so that the instance_type is used to retrieve image_uri under the hood. The quick fix can be either:
    • Provide image_uri to the estimator/processor
    • Or Just simply update the instance_type to be a plain string (This can be an easier fix)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug
Projects
None yet
Development

No branches or pull requests

1 participant