aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
9.87k stars 6.71k forks source link

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

Open acere opened 2 years ago

acere commented 2 years ago

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)
siddhantkhadgi commented 1 month ago

Hello, Im still getting an error with non zero exit status 1 while docker is trying to pull an image. How do I solve it?