diff --git a/sagemaker-python-sdk/1P_kmeans_highlevel/kmeans_mnist.ipynb b/sagemaker-python-sdk/1P_kmeans_highlevel/kmeans_mnist.ipynb index 2f3ff60fa3..a3971c6bf2 100644 --- a/sagemaker-python-sdk/1P_kmeans_highlevel/kmeans_mnist.ipynb +++ b/sagemaker-python-sdk/1P_kmeans_highlevel/kmeans_mnist.ipynb @@ -59,20 +59,6 @@ "bucket=''" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "data_key = 'kmeans_example/data'\n", - "data_location = 's3://{}/{}'.format(bucket, data_key)\n", - "output_location = 's3://{}/kmeans_example/output'.format(bucket)\n", - "\n", - "print('training data will be uploaded to: {}'.format(data_location))\n", - "print('training artifacts will be uploaded to: {}'.format(output_location))" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -149,6 +135,12 @@ "source": [ "from sagemaker import KMeans\n", "\n", + "data_location = 's3://{}/kmeans_highlevel_example/data'.format(bucket)\n", + "output_location = 's3://{}/kmeans_example/output'.format(bucket)\n", + "\n", + "print('training data will be uploaded to: {}'.format(data_location))\n", + "print('training artifacts will be uploaded to: {}'.format(output_location))\n", + "\n", "kmeans = KMeans(role=role,\n", " train_instance_count=2,\n", " train_instance_type='ml.c4.8xlarge',\n", @@ -281,10 +273,8 @@ "metadata": {}, "outputs": [], "source": [ - "# Uncomment and run to delete\n", - "\n", - "#import sagemaker\n", - "#sagemaker.Session().delete_endpoint(kmeans_predictor.endpoint)" + "import sagemaker\n", + "sagemaker.Session().delete_endpoint(kmeans_predictor.endpoint)" ] } ], diff --git a/sagemaker-python-sdk/1P_kmeans_lowlevel/kmeans_mnist_lowlevel.ipynb b/sagemaker-python-sdk/1P_kmeans_lowlevel/kmeans_mnist_lowlevel.ipynb index 68524bcd59..7d1b47a3b8 100644 --- a/sagemaker-python-sdk/1P_kmeans_lowlevel/kmeans_mnist_lowlevel.ipynb +++ b/sagemaker-python-sdk/1P_kmeans_lowlevel/kmeans_mnist_lowlevel.ipynb @@ -59,20 +59,6 @@ "bucket=''" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "data_key = 'kmeans_example/data'\n", - "data_location = 's3://{}/{}'.format(bucket, data_key)\n", - "output_location = 's3://{}/kmeans_example/output'.format(bucket)\n", - "\n", - "print('training data will be uploaded to: {}'.format(data_location))\n", - "print('training artifacts will be uploaded to: {}'.format(output_location))" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -152,6 +138,10 @@ "import io\n", "import boto3\n", "\n", + "data_key = 'kmeans_lowlevel_example/data'\n", + "data_location = 's3://{}/{}'.format(bucket, data_key)\n", + "print('training data will be uploaded to: {}'.format(data_location))\n", + "\n", "# Convert the training data into the format required by the SageMaker KMeans algorithm\n", "buf = io.BytesIO()\n", "write_numpy_to_dense_tensor(buf, train_set[0], train_set[1])\n", @@ -190,6 +180,9 @@ " 'eu-west-1': '438346466558.dkr.ecr.eu-west-1.amazonaws.com/kmeans:latest'}\n", "image = images[boto3.Session().region_name]\n", "\n", + "output_location = 's3://{}/kmeans_example/output'.format(bucket)\n", + "print('training artifacts will be uploaded to: {}'.format(output_location))\n", + "\n", "create_training_params = \\\n", "{\n", " \"AlgorithmSpecification\": {\n", @@ -473,9 +466,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Uncomment and run to delete\n", - "\n", - "# sagemaker.delete_endpoint(EndpointName=endpoint_name)" + "sagemaker.delete_endpoint(EndpointName=endpoint_name)" ] } ],