|
30 | 30 | "\n",
|
31 | 31 | "This notebook can be compared to [Iris classification example notebook](../tensorflow_iris_dnn_classifier_using_estimators/tensorflow_iris_dnn_classifier_using_estimators.ipynb) in terms of its functionality. We will do the same classification task, but we will train the same network locally in the box from where this notebook is being run. We then setup a real-time hosted endpoint in SageMaker.\n",
|
32 | 32 | "\n",
|
33 |
| - "Consider the following model definition for IRIS classification. This mdoe uses the ``tensorflow.estimator.DNNClassifier`` which is a pre-defined enstimator module for its model definition. The model definition is the same as the one used in the [Iris classification example notebook](../tensorflow_iris_dnn_classifier_using_estimators/tensorflow_iris_dnn_classifier_using_estimators.ipynb)\n", |
| 33 | + "Consider the following model definition for IRIS classification. This mode uses the ``tensorflow.estimator.DNNClassifier`` which is a pre-defined estimator module for its model definition. The model definition is the same as the one used in the [Iris classification example notebook](../tensorflow_iris_dnn_classifier_using_estimators/tensorflow_iris_dnn_classifier_using_estimators.ipynb)\n", |
34 | 34 | "\n",
|
35 | 35 | "## Prequisites and Preprocessing\n",
|
36 | 36 | "### Permissions and environment variables\n",
|
37 | 37 | "\n",
|
38 |
| - "Here we set up the linkage and authentication to AWS services. In this notebook we only need the roles used to give learning and hosting access to your data. The Sagemaker SDK will use S3 defualt buckets when needed. Supply the role in the variable below." |
| 38 | + "Here we set up the linkage and authentication to AWS services. In this notebook we only need the roles used to give learning and hosting access to your data. The Sagemaker SDK will use S3 defualt buckets when needed. If the ``get_execution_role`` does not return a role with the appropriate permissions, you'll need to specify an IAM role arn that does." |
39 | 39 | ]
|
40 | 40 | },
|
41 | 41 | {
|
|
184 | 184 | "source": [
|
185 | 185 | "from iris_dnn_classifier import serving_input_fn\n",
|
186 | 186 | "\n",
|
187 |
| - "\"\"\"from tensorflow.contrib.learn import make_export_strategy \n", |
188 |
| - "export_strategy = make_export_strategy( serving_input_fn = serving_input_fn,\n", |
189 |
| - " exports_to_keep=1)\n", |
190 |
| - "exported_model = export_strategy.export(estimator = classifier, export_path = 'export/Servo/')\"\"\"\n", |
191 | 187 | "exported_model = classifier.export_savedmodel(export_dir_base = 'export/Servo/', \n",
|
192 | 188 | " serving_input_receiver_fn = serving_input_fn)\n",
|
193 | 189 | "\n",
|
|
247 | 243 | "source": [
|
248 | 244 | "### Create endpoint\n",
|
249 | 245 | "\n",
|
250 |
| - "Now the model is ready to be deployed at a SageMaker endpoint. We can use the ``sagemaker.mxnet.model.TensorFlowModel.deploy`` method to do this. Unless you have created or prefer other instances, we recommend using 1 ``'ml.c4.xlarge'`` instance for this training. These are supplied as arguments. " |
| 246 | + "Now the model is ready to be deployed at a SageMaker endpoint. We can use the ``sagemaker.mxnet.model.TensorFlowModel.deploy`` method to do this. Unless you have created or prefer other instances, we recommend using 1 ``'ml.c4.xlarge'`` instance for this example. These are supplied as arguments. " |
251 | 247 | ]
|
252 | 248 | },
|
253 | 249 | {
|
|
267 | 263 | "source": [
|
268 | 264 | "### Validate the endpoint for use\n",
|
269 | 265 | "\n",
|
270 |
| - "We can now use this endpoint to classify. Run a sample prediction on a sample to ensure that it works. Expect result ``1`` for this particular sample." |
| 266 | + "We can now use this endpoint to classify. Run an example prediction on a sample to ensure that it works." |
271 | 267 | ]
|
272 | 268 | },
|
273 | 269 | {
|
|
304 | 300 | "cell_type": "markdown",
|
305 | 301 | "metadata": {},
|
306 | 302 | "source": [
|
307 |
| - "If you do not want continied use of the endpoint, you can remove it. Remember, open endpoints are charged. If this is a simple test or practice, it is recommended to delete them." |
| 303 | + "If you do not want to continue using the endpoint, you can remove it. Remember, open endpoints are charged. If this is a simple test or practice, it is recommended to delete them." |
308 | 304 | ]
|
309 | 305 | },
|
310 | 306 | {
|
|
0 commit comments