Skip to content

Commit 2093540

Browse files
committed
Fix aws#410: Documentation code should not run
1 parent dd9f4a0 commit 2093540

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

sagemaker-python-sdk/tensorflow_pipemode_example/tensorflow_pipemode_example.ipynb

+18-16
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": 1,
28+
"execution_count": null,
2929
"metadata": {
3030
"isConfigCell": true
3131
},
3232
"outputs": [],
3333
"source": [
3434
"from sagemaker import get_execution_role\n",
35+
"#IAM execution role that gives SageMaker access to resources in your AWS account.\n",
36+
"role = get_execution_role()\n",
3537
"\n",
3638
"#Bucket location to save your custom code in tar.gz format.\n",
37-
"custom_code_upload_location = 's3://<bucket-name>/customcode/tensorflow_pipemode'\n",
39+
"bucket = '<bucket-name>'\n",
40+
"custom_code_upload_location = 's3://{}/customcode/tensorflow_pipemode'.format(bucket)\n",
3841
"\n",
3942
"#Bucket location where results of model training are saved.\n",
40-
"model_artifacts_location = 's3://<bucket-name>/artifacts'\n",
41-
"\n",
42-
"#IAM execution role that gives SageMaker access to resources in your AWS account.\n",
43-
"role = get_execution_role()\n"
43+
"model_artifacts_location = 's3://{}/artifacts'.format(bucket)"
4444
]
4545
},
4646
{
@@ -61,6 +61,13 @@
6161
"!cat \"pipemode.py\""
6262
]
6363
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"The above script implements all the functions required for a sagemaker tensorflow training script (See: [Preparing TensorFlow Training Script](https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/tensorflow/README.rst#preparing-the-tensorflow-training-script)). "
69+
]
70+
},
6471
{
6572
"cell_type": "markdown",
6673
"metadata": {},
@@ -72,15 +79,9 @@
7279
"\n",
7380
"The training and evaluation data were produced using the benchmarking source code in the sagemaker-tensorflow-extensions benchmarking sub-package. If you want to investigate this further, please visit the GitHub repository for sagemaker-tensorflow-extensions at https://github.com/aws/sagemaker-tensorflow-extensions. \n",
7481
"\n",
75-
"The following example code shows how to use a PipeModeDataset in an input_fn."
76-
]
77-
},
78-
{
79-
"cell_type": "code",
80-
"execution_count": null,
81-
"metadata": {},
82-
"outputs": [],
83-
"source": [
82+
"The following example code shows how to use a PipeModeDataset in an input_fn.\n",
83+
"\n",
84+
"```python\n",
8485
"from sagemaker_tensorflow import PipeModeDataset\n",
8586
"\n",
8687
"def input_fn():\n",
@@ -107,7 +108,8 @@
107108
" ds = ds.map(parse, num_parallel_calls=10)\n",
108109
" ds = ds.batch(64)\n",
109110
" \n",
110-
" return ds"
111+
" return ds\n",
112+
"```"
111113
]
112114
},
113115
{

0 commit comments

Comments
 (0)