|
23 | 23 | "outputs": [],
|
24 | 24 | "source": [
|
25 | 25 | "from sagemaker import get_execution_role\n",
|
| 26 | + "from sagemaker.session import Session\n", |
26 | 27 | "\n",
|
27 |
| - "#Bucket location to save your custom code in tar.gz format.\n", |
28 |
| - "custom_code_upload_location = 's3://<bucket-name>/customcode/mxnet'\n", |
| 28 | + "# S3 bucket for saving code and model artifacts.\n", |
| 29 | + "# Feel free to specify a different bucket here if you wish.\n", |
| 30 | + "bucket = Session().default_bucket()\n", |
29 | 31 | "\n",
|
30 |
| - "#Bucket location where results of model training are saved.\n", |
31 |
| - "model_artifacts_location = 's3://<bucket-name>/artifacts'\n", |
| 32 | + "# Location to save your custom code in tar.gz format.\n", |
| 33 | + "custom_code_upload_location = 's3://{}/customcode/mxnet'.format(bucket)\n", |
32 | 34 | "\n",
|
33 |
| - "#IAM execution role that gives SageMaker access to resources in your AWS account.\n", |
34 |
| - "#We can use the SageMaker Python SDK to get the role from our notebook environment. \n", |
| 35 | + "# Location where results of model training are saved.\n", |
| 36 | + "model_artifacts_location = 's3://{}/artifacts'.format(bucket)\n", |
| 37 | + "\n", |
| 38 | + "# IAM execution role that gives SageMaker access to resources in your AWS account.\n", |
| 39 | + "# We can use the SageMaker Python SDK to get the role from our notebook environment. \n", |
35 | 40 | "role = get_execution_role()"
|
36 | 41 | ]
|
37 | 42 | },
|
|
234 | 239 | "\n",
|
235 | 240 | "sagemaker.Session().delete_endpoint(predictor.endpoint)"
|
236 | 241 | ]
|
237 |
| - }, |
238 |
| - { |
239 |
| - "cell_type": "code", |
240 |
| - "execution_count": null, |
241 |
| - "metadata": { |
242 |
| - "collapsed": true |
243 |
| - }, |
244 |
| - "outputs": [], |
245 |
| - "source": [] |
246 | 242 | }
|
247 | 243 | ],
|
248 | 244 | "metadata": {
|
249 | 245 | "kernelspec": {
|
250 |
| - "display_name": "Environment (conda_mxnet_p36)", |
| 246 | + "display_name": "conda_mxnet_p36", |
251 | 247 | "language": "python",
|
252 | 248 | "name": "conda_mxnet_p36"
|
253 | 249 | },
|
|
261 | 257 | "name": "python",
|
262 | 258 | "nbconvert_exporter": "python",
|
263 | 259 | "pygments_lexer": "ipython3",
|
264 |
| - "version": "3.6.3" |
| 260 | + "version": "3.6.5" |
265 | 261 | },
|
266 | 262 | "notice": "Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."
|
267 | 263 | },
|
|
0 commit comments