Skip to content

Commit 9bf5be5

Browse files
Hannah14295hrehard
andauthored
fix(examples): use Session instance for region in train-inference-e2e (#6050)
The train-inference-e2e-example config cell read AWS_REGION off the Session class (AWS_REGION = Session.boto_region_name). boto_region_name is an instance @Property, so class access returns the property object rather than a region string; the subsequent boto3.Session(region_name=AWS_REGION) then fails with 'TypeError: expected string or bytes-like object, got property' and PYTORCH_TRAINING_IMAGE is built with a bogus region. Instantiate a Session and read the property off the instance. Co-authored-by: hrehard <hrehard@amazon.com>
1 parent f81c590 commit 9bf5be5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎v3-examples/inference-examples/train-inference-e2e-example.ipynb‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
"TRAINING_JOB_PREFIX = \"e2e-v3-pytorch\"\n",
6262
"\n",
6363
"# AWS Configuration\n",
64-
"AWS_REGION = Session.boto_region_name\n",
64+
"session = Session()\n",
65+
"AWS_REGION = session.boto_region_name\n",
6566
"PYTORCH_TRAINING_IMAGE = f\"763104351884.dkr.ecr.{AWS_REGION}.amazonaws.com/pytorch-training:1.13.1-cpu-py39\"\n",
6667
"\n",
6768
"# Generate unique identifiers\n",

0 commit comments

Comments
 (0)