|
41 | 41 | "cell_type": "code",
|
42 | 42 | "execution_count": null,
|
43 | 43 | "metadata": {
|
44 |
| - "collapsed": true, |
45 | 44 | "isConfigCell": true
|
46 | 45 | },
|
47 | 46 | "outputs": [],
|
|
55 | 54 | "cell_type": "markdown",
|
56 | 55 | "metadata": {},
|
57 | 56 | "source": [
|
58 |
| - "This notebook shows how to use the SageMaker Python SDK to run your code in a local container before deploying to SageMaker's managed training or hosting environments. Just change your estimator's train_instance_type to local or local_gpu. For more information, see [local mode](https://github.com/aws/sagemaker-python-sdk#local-mode).\n", |
| 57 | + "This notebook shows how to use the SageMaker Python SDK to run your code in a local container before deploying to SageMaker's managed training or hosting environments. Just change your estimator's instance_type to local or local_gpu. For more information, see [local mode](https://github.com/aws/sagemaker-python-sdk#local-mode).\n", |
59 | 58 | "\n",
|
60 | 59 | "To use Amazon Elastic Inference locally change your `accelerator_type` to `local_sagemaker_notebook` when calling `deploy()`.\n",
|
61 | 60 | "\n",
|
|
106 | 105 | "source": [
|
107 | 106 | "The SageMaker ```MXNet``` estimator allows us to run single machine or distributed training in SageMaker, using CPU or GPU-based instances.\n",
|
108 | 107 | "\n",
|
109 |
| - "When we create the estimator, we pass in the filename of our training script, the name of our IAM execution role, and the S3 locations we defined in the setup section. We also provide a few other parameters. ``train_instance_count`` and ``train_instance_type`` determine the number and type of SageMaker instances that will be used for the training job. The ``hyperparameters`` parameter is a ``dict`` of values that will be passed to your training script -- you can see how to access these values in the ``mnist.py`` script above.\n", |
| 108 | + "When we create the estimator, we pass in the filename of our training script, the name of our IAM execution role, and the S3 locations we defined in the setup section. We also provide a few other parameters. ``instance_count`` and ``instance_type`` determine the number and type of SageMaker instances that will be used for the training job. The ``hyperparameters`` parameter is a ``dict`` of values that will be passed to your training script -- you can see how to access these values in the ``mnist.py`` script above.\n", |
110 | 109 | "\n",
|
111 |
| - "For this example, we will train our model on the local instance this notebook is running on. This is achieved by using `local` for `train_instance_type`. By passing local, training will be done inside of a Docker container on this notebook instance." |
| 110 | + "For this example, we will train our model on the local instance this notebook is running on. This is achieved by using `local` for `instance_type`. By passing local, training will be done inside of a Docker container on this notebook instance." |
112 | 111 | ]
|
113 | 112 | },
|
114 | 113 | {
|
115 | 114 | "cell_type": "code",
|
116 | 115 | "execution_count": null,
|
117 |
| - "metadata": { |
118 |
| - "collapsed": true |
119 |
| - }, |
| 116 | + "metadata": {}, |
120 | 117 | "outputs": [],
|
121 | 118 | "source": [
|
122 | 119 | "from sagemaker.mxnet import MXNet\n",
|
123 | 120 | "\n",
|
124 | 121 | "mnist_estimator = MXNet(entry_point='mnist.py',\n",
|
125 | 122 | " role=role,\n",
|
126 |
| - " train_instance_count=1,\n", |
127 |
| - " train_instance_type='local',\n", |
| 123 | + " instance_count=1,\n", |
| 124 | + " instance_type='local',\n", |
128 | 125 | " framework_version='1.4.1',\n",
|
129 | 126 | " py_version='py3',\n",
|
130 | 127 | " hyperparameters={'learning-rate': 0.1})"
|
|
287 | 284 | {
|
288 | 285 | "cell_type": "code",
|
289 | 286 | "execution_count": null,
|
290 |
| - "metadata": { |
291 |
| - "collapsed": true |
292 |
| - }, |
| 287 | + "metadata": {}, |
293 | 288 | "outputs": [],
|
294 | 289 | "source": [
|
295 | 290 | "print(\"Endpoint name: \" + predictor.endpoint)"
|
|
298 | 293 | {
|
299 | 294 | "cell_type": "code",
|
300 | 295 | "execution_count": null,
|
301 |
| - "metadata": { |
302 |
| - "collapsed": true |
303 |
| - }, |
| 296 | + "metadata": {}, |
304 | 297 | "outputs": [],
|
305 | 298 | "source": [
|
306 | 299 | "import sagemaker\n",
|
307 | 300 | "\n",
|
308 | 301 | "predictor.delete_endpoint()"
|
309 | 302 | ]
|
| 303 | + }, |
| 304 | + { |
| 305 | + "cell_type": "code", |
| 306 | + "execution_count": null, |
| 307 | + "metadata": {}, |
| 308 | + "outputs": [], |
| 309 | + "source": [] |
310 | 310 | }
|
311 | 311 | ],
|
312 | 312 | "metadata": {
|
|
325 | 325 | "name": "python",
|
326 | 326 | "nbconvert_exporter": "python",
|
327 | 327 | "pygments_lexer": "ipython3",
|
328 |
| - "version": "3.6.5" |
| 328 | + "version": "3.6.10" |
329 | 329 | },
|
330 | 330 | "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."
|
331 | 331 | },
|
|
0 commit comments