|
25 | 25 | }, |
26 | 26 | { |
27 | 27 | "cell_type": "code", |
28 | | - "execution_count": 1, |
| 28 | + "execution_count": null, |
29 | 29 | "metadata": { |
30 | 30 | "isConfigCell": true |
31 | 31 | }, |
32 | 32 | "outputs": [], |
33 | 33 | "source": [ |
34 | 34 | "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", |
35 | 37 | "\n", |
36 | 38 | "#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", |
38 | 41 | "\n", |
39 | 42 | "#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)" |
44 | 44 | ] |
45 | 45 | }, |
46 | 46 | { |
|
61 | 61 | "!cat \"pipemode.py\"" |
62 | 62 | ] |
63 | 63 | }, |
| 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 | + }, |
64 | 71 | { |
65 | 72 | "cell_type": "markdown", |
66 | 73 | "metadata": {}, |
|
72 | 79 | "\n", |
73 | 80 | "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", |
74 | 81 | "\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", |
84 | 85 | "from sagemaker_tensorflow import PipeModeDataset\n", |
85 | 86 | "\n", |
86 | 87 | "def input_fn():\n", |
|
107 | 108 | " ds = ds.map(parse, num_parallel_calls=10)\n", |
108 | 109 | " ds = ds.batch(64)\n", |
109 | 110 | " \n", |
110 | | - " return ds" |
| 111 | + " return ds\n", |
| 112 | + "```" |
111 | 113 | ] |
112 | 114 | }, |
113 | 115 | { |
|
0 commit comments