amazon-sagemaker-examples icon indicating copy to clipboard operation
amazon-sagemaker-examples copied to clipboard

Harcoded image URI prevents running the examples in regions different than `us-west-2`

Open acere opened this issue 1 year ago • 1 comments

Link to the notebook https://github.com/aws/amazon-sagemaker-examples/blob/main/reinforcement_learning/bandits_recsys_movielens_testbed/bandits_movielens_testbed.ipynb

Describe the bug The notebook uses an hardcoded image URI . THis is unnecessary, and prevents running the notebook in regions different than us-west-2.
The notebook contains a check to validate the region, but this should not be necessary.

To reproduce Execute the notebook as is in a SageMaker Notebook instance in a region different than us-west-2 ignoring the exception raised by the region check.

Suggested fix replace

vw_image_uri = "462105765813.dkr.ecr.us-west-2.amazonaws.com/sagemaker-rl-vw-container:adf"

with

vw_image_uri = sagemaker.image_uris.retrieve(framework='vw', region=aws_region)

acere avatar Jul 26 '22 01:07 acere