Skip to content

Commit 4a9456a

Browse files
committed
changed instance type
1 parent 4f6a7ce commit 4a9456a

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

sagemaker-python-sdk/tensorflow_resnet_cifar10_with_tensorboard/tensorflow_resnet_cifar10_with_tensorboard.ipynb

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
{
2626
"cell_type": "code",
27-
"execution_count": 1,
27+
"execution_count": null,
2828
"metadata": {
2929
"collapsed": true
3030
},
@@ -33,11 +33,11 @@
3333
"import os\n",
3434
"import sagemaker\n",
3535
"import tensorflow\n",
36+
"from sagemaker import get_execution_role\n",
3637
"\n",
3738
"sagemaker_session = sagemaker.Session()\n",
3839
"\n",
39-
"# Replace with a role (either name or full arn) that gives SageMaker access to S3 and cloudwatch\n",
40-
"role='SageMakerRole'"
40+
"role = get_execution_role()"
4141
]
4242
},
4343
{
@@ -50,19 +50,11 @@
5050
},
5151
{
5252
"cell_type": "code",
53-
"execution_count": 2,
53+
"execution_count": null,
5454
"metadata": {
5555
"scrolled": false
5656
},
57-
"outputs": [
58-
{
59-
"name": "stdout",
60-
"output_type": "stream",
61-
"text": [
62-
"cifar dataset already downloaded\n"
63-
]
64-
}
65-
],
57+
"outputs": [],
6658
"source": [
6759
"import utils\n",
6860
"\n",
@@ -78,7 +70,7 @@
7870
},
7971
{
8072
"cell_type": "code",
81-
"execution_count": 3,
73+
"execution_count": null,
8274
"metadata": {
8375
"collapsed": true
8476
},
@@ -114,7 +106,6 @@
114106
"cell_type": "code",
115107
"execution_count": null,
116108
"metadata": {
117-
"collapsed": true,
118109
"scrolled": false
119110
},
120111
"outputs": [],
@@ -126,8 +117,8 @@
126117
"estimator = TensorFlow(entry_point='resnet_cifar_10.py',\n",
127118
" source_dir=source_dir,\n",
128119
" role=role,\n",
129-
" training_steps=1000, evaluation_steps=100,\n",
130-
" train_instance_count=1, train_instance_type='ml.p2.xlarge', \n",
120+
" training_steps=3000, evaluation_steps=100,\n",
121+
" train_instance_count=2, train_instance_type='ml.c4.xlarge', \n",
131122
" base_job_name='tensorboard-example')\n",
132123
"\n",
133124
"estimator.fit(inputs, run_tensorboard_locally=True)"
@@ -137,7 +128,7 @@
137128
"cell_type": "markdown",
138129
"metadata": {},
139130
"source": [
140-
"The **```fit```** method will create a training job named **```tensorboard-example-{unique identifier}```**in a p2 instance. That instance will write checkpoints to the s3 bucket **```sagemaker-{your aws account number}```**.\n",
131+
"The **```fit```** method will create a training job named **```tensorboard-example-{unique identifier}```** in two **ml.c4.xlarge** instances. These instances will write checkpoints to the s3 bucket **```sagemaker-{your aws account number}```**.\n",
141132
"\n",
142133
"If you don't have this bucket yet, **```sagemaker_session```** will create it for you. These checkpoints can be used for restoring the training job, and to analyze training job metrics using **TensorBoard**. \n",
143134
"\n",
@@ -164,9 +155,7 @@
164155
{
165156
"cell_type": "code",
166157
"execution_count": null,
167-
"metadata": {
168-
"collapsed": true
169-
},
158+
"metadata": {},
170159
"outputs": [],
171160
"source": [
172161
"predictor = estimator.deploy(initial_instance_count=1, instance_type='ml.c4.xlarge')"
@@ -176,8 +165,8 @@
176165
"cell_type": "markdown",
177166
"metadata": {},
178167
"source": [
179-
"# Deleting the endpoint\n",
180-
"**Important** "
168+
"# Cleaning up\n",
169+
"To avoid incurring charges to your AWS account for the resources used in this tutorial you need to delete the **SageMaker Endpoint:**"
181170
]
182171
},
183172
{

0 commit comments

Comments
 (0)