From 3c26f7067e886df030d73faf3603a5848675ccb4 Mon Sep 17 00:00:00 2001 From: "Santiago L. Valdarrama" Date: Thu, 26 Oct 2023 14:28:48 -0400 Subject: [PATCH] Fixed issue with the Lambda Role --- program/cohort.ipynb | 295 ++++++++++++++++++++++++++----------------- 1 file changed, 176 insertions(+), 119 deletions(-) diff --git a/program/cohort.ipynb b/program/cohort.ipynb index 22b8df0..92043ab 100644 --- a/program/cohort.ipynb +++ b/program/cohort.ipynb @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 277, + "execution_count": 460, "id": "4b2265b0", "metadata": {}, "outputs": [ @@ -101,7 +101,7 @@ }, { "cell_type": "code", - "execution_count": 278, + "execution_count": 461, "id": "32c4d764", "metadata": {}, "outputs": [], @@ -119,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 279, + "execution_count": 462, "id": "3164a3af", "metadata": {}, "outputs": [], @@ -142,7 +142,7 @@ }, { "cell_type": "code", - "execution_count": 280, + "execution_count": 463, "id": "7bc40d28", "metadata": {}, "outputs": [], @@ -161,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 281, + "execution_count": 464, "id": "3b3f17e5", "metadata": {}, "outputs": [], @@ -201,7 +201,7 @@ }, { "cell_type": "code", - "execution_count": 282, + "execution_count": 465, "id": "942a01b5", "metadata": {}, "outputs": [], @@ -242,7 +242,7 @@ }, { "cell_type": "code", - "execution_count": 283, + "execution_count": 466, "id": "f1cd2f0e-446d-48a9-a008-b4f1cc593bfc", "metadata": { "tags": [] @@ -349,7 +349,7 @@ "4 3450.0 FEMALE " ] }, - "execution_count": 283, + "execution_count": 466, "metadata": {}, "output_type": "execute_result" } @@ -386,7 +386,7 @@ }, { "cell_type": "code", - "execution_count": 284, + "execution_count": 467, "id": "f2107c25-e730-4e22-a1b8-5bda53e61124", "metadata": { "tags": [] @@ -565,7 +565,7 @@ "max 6300.000000 NaN " ] }, - "execution_count": 284, + "execution_count": 467, "metadata": {}, "output_type": "execute_result" } @@ -584,7 +584,7 @@ }, { "cell_type": "code", - "execution_count": 285, + "execution_count": 468, "id": "1242122a-726e-4c37-a718-dd8e873d1612", "metadata": { "tags": [] @@ -642,7 +642,7 @@ }, { "cell_type": "code", - "execution_count": 286, + "execution_count": 469, "id": "cf1cf582-8831-4f83-bb17-2175afb193e8", "metadata": { "tags": [] @@ -657,7 +657,7 @@ "Name: count, dtype: int64" ] }, - "execution_count": 286, + "execution_count": 469, "metadata": {}, "output_type": "execute_result" } @@ -677,7 +677,7 @@ }, { "cell_type": "code", - "execution_count": 287, + "execution_count": 470, "id": "cc42cb08-275c-4b05-9d2b-77052da2f336", "metadata": { "tags": [] @@ -696,7 +696,7 @@ "dtype: int64" ] }, - "execution_count": 287, + "execution_count": 470, "metadata": {}, "output_type": "execute_result" } @@ -715,7 +715,7 @@ }, { "cell_type": "code", - "execution_count": 288, + "execution_count": 471, "id": "3c57d55d-afd6-467a-a7a8-ff04132770ed", "metadata": { "tags": [] @@ -734,7 +734,7 @@ "dtype: int64" ] }, - "execution_count": 288, + "execution_count": 471, "metadata": {}, "output_type": "execute_result" } @@ -757,7 +757,7 @@ }, { "cell_type": "code", - "execution_count": 289, + "execution_count": 472, "id": "2852c740", "metadata": {}, "outputs": [ @@ -803,7 +803,7 @@ }, { "cell_type": "code", - "execution_count": 290, + "execution_count": 473, "id": "707cc972", "metadata": {}, "outputs": [ @@ -851,7 +851,7 @@ }, { "cell_type": "code", - "execution_count": 291, + "execution_count": 474, "id": "3daf3ba1-d218-4ad4-b862-af679b91273f", "metadata": { "tags": [] @@ -931,7 +931,7 @@ "body_mass_g 640316.716388 " ] }, - "execution_count": 291, + "execution_count": 474, "metadata": {}, "output_type": "execute_result" } @@ -956,7 +956,7 @@ }, { "cell_type": "code", - "execution_count": 292, + "execution_count": 475, "id": "1d793e09-2cb9-47ff-a0e6-199a0f4fc1b3", "metadata": { "tags": [] @@ -1036,7 +1036,7 @@ "body_mass_g 1.000000 " ] }, - "execution_count": 292, + "execution_count": 475, "metadata": {}, "output_type": "execute_result" } @@ -1061,7 +1061,7 @@ }, { "cell_type": "code", - "execution_count": 293, + "execution_count": 476, "id": "1258c99d", "metadata": {}, "outputs": [ @@ -1101,7 +1101,7 @@ }, { "cell_type": "code", - "execution_count": 294, + "execution_count": 477, "id": "45b0a87f-028d-477f-9b65-199728c0b7ee", "metadata": { "tags": [] @@ -1155,7 +1155,7 @@ }, { "cell_type": "code", - "execution_count": 295, + "execution_count": 478, "id": "fb6ba7c0-1bd6-4fe5-8b7f-f6cbdfd3846c", "metadata": { "tags": [] @@ -1351,7 +1351,7 @@ }, { "cell_type": "code", - "execution_count": 296, + "execution_count": 479, "id": "d1f122a4-acff-4687-91b9-bfef13567d88", "metadata": { "tags": [] @@ -1362,7 +1362,7 @@ "output_type": "stream", "text": [ "\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\u001b[32m.\u001b[0m\n", - "\u001b[32m\u001b[32m\u001b[1m8 passed\u001b[0m\u001b[32m in 0.17s\u001b[0m\u001b[0m\n" + "\u001b[32m\u001b[32m\u001b[1m8 passed\u001b[0m\u001b[32m in 0.16s\u001b[0m\u001b[0m\n" ] } ], @@ -1489,7 +1489,7 @@ }, { "cell_type": "code", - "execution_count": 297, + "execution_count": 480, "id": "d88e9ccf", "metadata": {}, "outputs": [], @@ -1509,7 +1509,7 @@ }, { "cell_type": "code", - "execution_count": 298, + "execution_count": 481, "id": "331fe373", "metadata": {}, "outputs": [], @@ -1532,7 +1532,7 @@ }, { "cell_type": "code", - "execution_count": 299, + "execution_count": 482, "id": "3aa4471a", "metadata": {}, "outputs": [ @@ -1573,7 +1573,7 @@ }, { "cell_type": "code", - "execution_count": 300, + "execution_count": 483, "id": "cdbd9303", "metadata": { "tags": [] @@ -1654,7 +1654,7 @@ }, { "cell_type": "code", - "execution_count": 301, + "execution_count": 484, "id": "e140642a", "metadata": { "tags": [] @@ -1664,16 +1664,16 @@ "data": { "text/plain": [ "{'PipelineArn': 'arn:aws:sagemaker:us-east-1:325223348818:pipeline/session1-pipeline',\n", - " 'ResponseMetadata': {'RequestId': '42674725-c31d-4b50-b8e3-79aa7f3bc160',\n", + " 'ResponseMetadata': {'RequestId': '897b79ee-a415-407f-8cff-927b5ce88443',\n", " 'HTTPStatusCode': 200,\n", - " 'HTTPHeaders': {'x-amzn-requestid': '42674725-c31d-4b50-b8e3-79aa7f3bc160',\n", + " 'HTTPHeaders': {'x-amzn-requestid': '897b79ee-a415-407f-8cff-927b5ce88443',\n", " 'content-type': 'application/x-amz-json-1.1',\n", " 'content-length': '85',\n", - " 'date': 'Tue, 24 Oct 2023 18:28:24 GMT'},\n", + " 'date': 'Thu, 26 Oct 2023 18:24:26 GMT'},\n", " 'RetryAttempts': 0}}" ] }, - "execution_count": 301, + "execution_count": 484, "metadata": {}, "output_type": "execute_result" } @@ -1722,7 +1722,7 @@ }, { "cell_type": "code", - "execution_count": 302, + "execution_count": 485, "id": "59d1e634", "metadata": {}, "outputs": [], @@ -1780,7 +1780,7 @@ }, { "cell_type": "code", - "execution_count": 303, + "execution_count": 486, "id": "d92b121d-dcb9-43e8-9ee3-3ececb583e7e", "metadata": { "tags": [] @@ -1889,7 +1889,7 @@ }, { "cell_type": "code", - "execution_count": 304, + "execution_count": 487, "id": "14ea27ce-c453-4cb0-b309-dbecd732957e", "metadata": { "tags": [] @@ -1906,16 +1906,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "8/8 - 0s - loss: 1.0366 - accuracy: 0.4226 - val_loss: 1.0048 - val_accuracy: 0.4314 - 234ms/epoch - 29ms/step\n", + "8/8 - 0s - loss: 1.2706 - accuracy: 0.1967 - val_loss: 1.2427 - val_accuracy: 0.1961 - 233ms/epoch - 29ms/step\n", "2/2 [==============================] - 0s 1ms/step\n", - "Validation accuracy: 0.43137254901960786\n" + "Validation accuracy: 0.19607843137254902\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "INFO:tensorflow:Assets written to: /var/folders/4c/v1q3hy1x4mb5w0wpc72zl3_w0000gp/T/tmpf0he4ftj/model/001/assets\n" + "INFO:tensorflow:Assets written to: /var/folders/4c/v1q3hy1x4mb5w0wpc72zl3_w0000gp/T/tmp9p6a3aw1/model/001/assets\n" ] }, { @@ -1992,7 +1992,7 @@ }, { "cell_type": "code", - "execution_count": 305, + "execution_count": 488, "id": "90fe82ae-6a2c-4461-bc83-bb52d8871e3b", "metadata": { "tags": [] @@ -2048,7 +2048,7 @@ }, { "cell_type": "code", - "execution_count": 306, + "execution_count": 489, "id": "99e4850c-83d6-4f4e-a813-d5a3f4bb7486", "metadata": { "tags": [] @@ -2113,12 +2113,12 @@ }, { "cell_type": "code", - "execution_count": 307, + "execution_count": 490, "id": "f367d0e3", "metadata": {}, "outputs": [], "source": [ - "USE_TUNING_STEP = False" + "USE_TUNING_STEP = True" ] }, { @@ -2144,7 +2144,7 @@ }, { "cell_type": "code", - "execution_count": 308, + "execution_count": 491, "id": "c8c82750", "metadata": {}, "outputs": [], @@ -2175,7 +2175,7 @@ }, { "cell_type": "code", - "execution_count": 309, + "execution_count": 492, "id": "038ff2e5-ed28-445b-bc03-4e996ec2286f", "metadata": { "tags": [] @@ -2218,7 +2218,7 @@ }, { "cell_type": "code", - "execution_count": 310, + "execution_count": 493, "id": "9799ab39-fcae-41f4-a68b-85ab71b3ba9a", "metadata": { "tags": [] @@ -2228,6 +2228,9 @@ "name": "stderr", "output_type": "stream", "text": [ + "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n" ] }, @@ -2235,7 +2238,6 @@ "name": "stdout", "output_type": "stream", "text": [ - "Using provided s3_resource\n", "Using provided s3_resource\n" ] }, @@ -2243,23 +2245,33 @@ "name": "stderr", "output_type": "stream", "text": [ + "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n" ] }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Using provided s3_resource\n" + ] + }, { "data": { "text/plain": [ "{'PipelineArn': 'arn:aws:sagemaker:us-east-1:325223348818:pipeline/session2-pipeline',\n", - " 'ResponseMetadata': {'RequestId': 'e06d0053-459e-4151-b9d6-79253eb517c9',\n", + " 'ResponseMetadata': {'RequestId': '10399618-0e30-49c0-8469-d57a2b2c3146',\n", " 'HTTPStatusCode': 200,\n", - " 'HTTPHeaders': {'x-amzn-requestid': 'e06d0053-459e-4151-b9d6-79253eb517c9',\n", + " 'HTTPHeaders': {'x-amzn-requestid': '10399618-0e30-49c0-8469-d57a2b2c3146',\n", " 'content-type': 'application/x-amz-json-1.1',\n", " 'content-length': '85',\n", - " 'date': 'Tue, 24 Oct 2023 18:28:26 GMT'},\n", + " 'date': 'Thu, 26 Oct 2023 18:24:28 GMT'},\n", " 'RetryAttempts': 0}}" ] }, - "execution_count": 310, + "execution_count": 493, "metadata": {}, "output_type": "execute_result" } @@ -2304,7 +2316,7 @@ }, { "cell_type": "code", - "execution_count": 311, + "execution_count": 494, "id": "274a9b1e", "metadata": {}, "outputs": [], @@ -2364,7 +2376,7 @@ }, { "cell_type": "code", - "execution_count": 312, + "execution_count": 495, "id": "3ee3ab26-afa5-4ceb-9f7a-005d5fdea646", "metadata": { "tags": [] @@ -2450,7 +2462,7 @@ }, { "cell_type": "code", - "execution_count": 313, + "execution_count": 496, "id": "9a2540d8-278a-4953-bc54-0469d154427d", "metadata": { "tags": [] @@ -2467,8 +2479,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "8/8 - 0s - loss: 1.0416 - accuracy: 0.3640 - val_loss: 1.0164 - val_accuracy: 0.3333 - 234ms/epoch - 29ms/step\n", - "2/2 [==============================] - 0s 2ms/step\n", + "8/8 - 0s - loss: 1.2804 - accuracy: 0.3724 - val_loss: 1.2486 - val_accuracy: 0.3333 - 229ms/epoch - 29ms/step\n", + "2/2 [==============================] - 0s 1ms/step\n", "Validation accuracy: 0.3333333333333333\n" ] }, @@ -2476,7 +2488,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "INFO:tensorflow:Assets written to: /var/folders/4c/v1q3hy1x4mb5w0wpc72zl3_w0000gp/T/tmpgy49w09u/model/001/assets\n", + "INFO:tensorflow:Assets written to: /var/folders/4c/v1q3hy1x4mb5w0wpc72zl3_w0000gp/T/tmpbuq_qc53/model/001/assets\n", "WARNING:absl:At this time, the v2.11+ optimizer `tf.keras.optimizers.RestoredOptimizer` runs slowly on M1/M2 Macs, please use the legacy Keras optimizer instead, located at `tf.keras.optimizers.legacy.RestoredOptimizer`.\n", "WARNING:absl:At this time, the v2.11+ optimizer `tf.keras.optimizers.SGD` runs slowly on M1/M2 Macs, please use the legacy Keras optimizer instead, located at `tf.keras.optimizers.legacy.SGD`.\n" ] @@ -2486,7 +2498,7 @@ "output_type": "stream", "text": [ "2/2 [==============================] - 0s 2ms/step\n", - "Test accuracy: 0.49019607843137253\n", + "Test accuracy: 0.37254901960784315\n", "\u001b[32m.\u001b[0m" ] }, @@ -2501,16 +2513,16 @@ "name": "stdout", "output_type": "stream", "text": [ - "8/8 - 0s - loss: 1.0747 - accuracy: 0.1841 - val_loss: 1.0577 - val_accuracy: 0.2549 - 227ms/epoch - 28ms/step\n", - "2/2 [==============================] - 0s 2ms/step\n", - "Validation accuracy: 0.2549019607843137\n" + "8/8 - 0s - loss: 1.1420 - accuracy: 0.2259 - val_loss: 1.1085 - val_accuracy: 0.1765 - 227ms/epoch - 28ms/step\n", + "2/2 [==============================] - 0s 1ms/step\n", + "Validation accuracy: 0.17647058823529413\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "INFO:tensorflow:Assets written to: /var/folders/4c/v1q3hy1x4mb5w0wpc72zl3_w0000gp/T/tmpk_wecsvh/model/001/assets\n", + "INFO:tensorflow:Assets written to: /var/folders/4c/v1q3hy1x4mb5w0wpc72zl3_w0000gp/T/tmpadkmzn92/model/001/assets\n", "WARNING:absl:At this time, the v2.11+ optimizer `tf.keras.optimizers.RestoredOptimizer` runs slowly on M1/M2 Macs, please use the legacy Keras optimizer instead, located at `tf.keras.optimizers.legacy.RestoredOptimizer`.\n", "WARNING:absl:At this time, the v2.11+ optimizer `tf.keras.optimizers.SGD` runs slowly on M1/M2 Macs, please use the legacy Keras optimizer instead, located at `tf.keras.optimizers.legacy.SGD`.\n" ] @@ -2519,10 +2531,10 @@ "name": "stdout", "output_type": "stream", "text": [ - "2/2 [==============================] - 0s 1ms/step\n", - "Test accuracy: 0.1568627450980392\n", + "2/2 [==============================] - 0s 2ms/step\n", + "Test accuracy: 0.13725490196078433\n", "\u001b[32m.\u001b[0m\n", - "\u001b[32m\u001b[32m\u001b[1m2 passed\u001b[0m\u001b[32m in 1.35s\u001b[0m\u001b[0m\n" + "\u001b[32m\u001b[32m\u001b[1m2 passed\u001b[0m\u001b[32m in 1.53s\u001b[0m\u001b[0m\n" ] } ], @@ -2605,7 +2617,7 @@ }, { "cell_type": "code", - "execution_count": 314, + "execution_count": 497, "id": "2fdff07f", "metadata": {}, "outputs": [ @@ -2645,7 +2657,7 @@ }, { "cell_type": "code", - "execution_count": 315, + "execution_count": 498, "id": "4f19e15b", "metadata": {}, "outputs": [], @@ -2666,7 +2678,7 @@ }, { "cell_type": "code", - "execution_count": 316, + "execution_count": 499, "id": "1f27b2ef", "metadata": {}, "outputs": [], @@ -2688,7 +2700,7 @@ }, { "cell_type": "code", - "execution_count": 317, + "execution_count": 500, "id": "48139a07-5c8e-4bc6-b666-bf9531f7f520", "metadata": { "tags": [] @@ -2755,7 +2767,7 @@ }, { "cell_type": "code", - "execution_count": 318, + "execution_count": 501, "id": "bb70f907", "metadata": {}, "outputs": [], @@ -2773,7 +2785,7 @@ }, { "cell_type": "code", - "execution_count": 319, + "execution_count": 502, "id": "4ca4cb61", "metadata": {}, "outputs": [], @@ -2799,7 +2811,7 @@ }, { "cell_type": "code", - "execution_count": 320, + "execution_count": 503, "id": "8c05a7e1", "metadata": {}, "outputs": [], @@ -2833,7 +2845,7 @@ }, { "cell_type": "code", - "execution_count": 321, + "execution_count": 504, "id": "c9773a4a", "metadata": { "tags": [] @@ -2894,7 +2906,7 @@ }, { "cell_type": "code", - "execution_count": 322, + "execution_count": 505, "id": "745486b5", "metadata": {}, "outputs": [], @@ -2914,7 +2926,7 @@ }, { "cell_type": "code", - "execution_count": 323, + "execution_count": 506, "id": "c4431bbf", "metadata": {}, "outputs": [], @@ -2943,7 +2955,7 @@ }, { "cell_type": "code", - "execution_count": 324, + "execution_count": 507, "id": "bebeecab", "metadata": {}, "outputs": [], @@ -2971,7 +2983,7 @@ }, { "cell_type": "code", - "execution_count": 325, + "execution_count": 508, "id": "36e2a2b1-6711-4266-95d8-d2aebd52e199", "metadata": { "tags": [] @@ -3000,7 +3012,7 @@ }, { "cell_type": "code", - "execution_count": 326, + "execution_count": 509, "id": "f70bcd33-b499-4e2b-953e-94d1ed96c10a", "metadata": { "tags": [] @@ -3010,6 +3022,9 @@ "name": "stderr", "output_type": "stream", "text": [ + "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n" ] }, @@ -3028,6 +3043,9 @@ "INFO:sagemaker.processing:Uploaded None to s3://mlschool/session3-pipeline/code/09fea667a5ab7c37a068f22c00762d0b/sourcedir.tar.gz\n", "INFO:sagemaker.processing:runproc.sh uploaded to s3://mlschool/session3-pipeline/code/2c207c809cb0e0e9a1d77e5247f961f9/runproc.sh\n", "WARNING:sagemaker.workflow._utils:Popping out 'CertifyForMarketplace' from the pipeline definition since it will be overridden in pipeline execution time.\n", + "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n" ] }, @@ -3051,16 +3069,16 @@ "data": { "text/plain": [ "{'PipelineArn': 'arn:aws:sagemaker:us-east-1:325223348818:pipeline/session3-pipeline',\n", - " 'ResponseMetadata': {'RequestId': '25850e57-1cdc-40f7-acf3-2b793dc77474',\n", + " 'ResponseMetadata': {'RequestId': 'cf5aa3ed-dccd-4874-81aa-a57f504759a1',\n", " 'HTTPStatusCode': 200,\n", - " 'HTTPHeaders': {'x-amzn-requestid': '25850e57-1cdc-40f7-acf3-2b793dc77474',\n", + " 'HTTPHeaders': {'x-amzn-requestid': 'cf5aa3ed-dccd-4874-81aa-a57f504759a1',\n", " 'content-type': 'application/x-amz-json-1.1',\n", " 'content-length': '85',\n", - " 'date': 'Tue, 24 Oct 2023 18:28:31 GMT'},\n", + " 'date': 'Thu, 26 Oct 2023 18:24:33 GMT'},\n", " 'RetryAttempts': 0}}" ] }, - "execution_count": 326, + "execution_count": 509, "metadata": {}, "output_type": "execute_result" } @@ -3107,7 +3125,7 @@ }, { "cell_type": "code", - "execution_count": 327, + "execution_count": 510, "id": "f3b4126e", "metadata": {}, "outputs": [], @@ -3121,6 +3139,33 @@ "session3_pipeline.start()" ] }, + { + "cell_type": "code", + "execution_count": 511, + "id": "9707976d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Name: sagemaker\n", + "Version: 2.192.1\n", + "Summary: Open source library for training and deploying models on Amazon SageMaker.\n", + "Home-page: https://github.com/aws/sagemaker-python-sdk/\n", + "Author: Amazon Web Services\n", + "Author-email: \n", + "License: Apache License 2.0\n", + "Location: /Users/svpino/dev/ml.school/.venv/lib/python3.9/site-packages\n", + "Requires: attrs, boto3, cloudpickle, google-pasta, importlib-metadata, jsonschema, numpy, packaging, pandas, pathos, platformdirs, protobuf, PyYAML, schema, smdebug-rulesconfig, tblib\n", + "Required-by: \n" + ] + } + ], + "source": [ + "!pip show sagemaker" + ] + }, { "cell_type": "markdown", "id": "9418693c-ccd5-42b6-8ec4-04bb70fe213c", @@ -3157,7 +3202,7 @@ }, { "cell_type": "code", - "execution_count": 328, + "execution_count": 512, "id": "befd5ad3", "metadata": {}, "outputs": [], @@ -3182,7 +3227,7 @@ }, { "cell_type": "code", - "execution_count": 329, + "execution_count": 513, "id": "87437a26-e9ea-4866-9dc3-630444c0fb46", "metadata": { "tags": [] @@ -3199,7 +3244,7 @@ " 'ModelApprovalStatus': 'Approved'}" ] }, - "execution_count": 329, + "execution_count": 513, "metadata": {}, "output_type": "execute_result" } @@ -3230,7 +3275,7 @@ }, { "cell_type": "code", - "execution_count": 330, + "execution_count": 514, "id": "dee516e9", "metadata": {}, "outputs": [], @@ -3266,7 +3311,7 @@ }, { "cell_type": "code", - "execution_count": 331, + "execution_count": 515, "id": "7c8852d5-818a-406c-944d-30bf6de90288", "metadata": { "tags": [] @@ -3297,7 +3342,7 @@ }, { "cell_type": "code", - "execution_count": 332, + "execution_count": 516, "id": "ba7da291", "metadata": {}, "outputs": [], @@ -3319,7 +3364,7 @@ }, { "cell_type": "code", - "execution_count": 333, + "execution_count": 517, "id": "0817a25e-8224-4911-830b-d659e7458b4a", "metadata": { "tags": [] @@ -3368,7 +3413,7 @@ }, { "cell_type": "code", - "execution_count": 334, + "execution_count": 518, "id": "6b32c3a4-312e-473c-a217-33606f77d1e9", "metadata": { "tags": [] @@ -3430,7 +3475,7 @@ }, { "cell_type": "code", - "execution_count": 335, + "execution_count": 519, "id": "e2d61d5c", "metadata": { "tags": [] @@ -3563,7 +3608,7 @@ }, { "cell_type": "code", - "execution_count": 336, + "execution_count": 520, "id": "33893ef2", "metadata": { "tags": [] @@ -3725,7 +3770,7 @@ }, { "cell_type": "code", - "execution_count": 337, + "execution_count": 521, "id": "48c69002", "metadata": { "tags": [] @@ -3834,7 +3879,7 @@ }, { "cell_type": "code", - "execution_count": 338, + "execution_count": 522, "id": "741b8402", "metadata": { "tags": [] @@ -3913,7 +3958,7 @@ }, { "cell_type": "code", - "execution_count": 339, + "execution_count": 523, "id": "53ea0ccf", "metadata": {}, "outputs": [], @@ -3939,7 +3984,7 @@ }, { "cell_type": "code", - "execution_count": 340, + "execution_count": 524, "id": "11a0effd", "metadata": {}, "outputs": [], @@ -3966,7 +4011,7 @@ }, { "cell_type": "code", - "execution_count": 341, + "execution_count": 525, "id": "5d7a5926", "metadata": {}, "outputs": [], @@ -3991,7 +4036,7 @@ }, { "cell_type": "code", - "execution_count": 342, + "execution_count": 526, "id": "157b8858", "metadata": { "tags": [] @@ -4020,7 +4065,7 @@ }, { "cell_type": "code", - "execution_count": 343, + "execution_count": 527, "id": "aefe580a", "metadata": {}, "outputs": [], @@ -4038,7 +4083,7 @@ }, { "cell_type": "code", - "execution_count": 344, + "execution_count": 528, "id": "f84d2cd5", "metadata": { "tags": [] @@ -4093,7 +4138,7 @@ }, { "cell_type": "code", - "execution_count": 345, + "execution_count": 529, "id": "b9712905-9fe3-4148-ae6d-05b0a48e742e", "metadata": { "tags": [] @@ -4120,7 +4165,7 @@ }, { "cell_type": "code", - "execution_count": 346, + "execution_count": 530, "id": "bad9f51d", "metadata": { "tags": [] @@ -4130,6 +4175,9 @@ "name": "stderr", "output_type": "stream", "text": [ + "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n" ] }, @@ -4154,6 +4202,9 @@ "name": "stderr", "output_type": "stream", "text": [ + "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", + "WARNING:sagemaker.estimator:No finished training job found associated with this estimator. Please make sure this estimator is only used for building workflow config\n", "INFO:sagemaker.image_uris:image_uri is not presented, retrieving image_uri based on instance_type, framework etc.\n" ] }, @@ -4161,7 +4212,6 @@ "name": "stdout", "output_type": "stream", "text": [ - "Using provided s3_resource\n", "Using provided s3_resource\n" ] }, @@ -4173,20 +4223,27 @@ "INFO:sagemaker.processing:runproc.sh uploaded to s3://mlschool/session4-pipeline/code/2c207c809cb0e0e9a1d77e5247f961f9/runproc.sh\n" ] }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Using provided s3_resource\n" + ] + }, { "data": { "text/plain": [ "{'PipelineArn': 'arn:aws:sagemaker:us-east-1:325223348818:pipeline/session4-pipeline',\n", - " 'ResponseMetadata': {'RequestId': '6b81bad9-1f68-4b36-bf30-b194f5097a55',\n", + " 'ResponseMetadata': {'RequestId': '510d5be0-0a1a-4daa-997a-12ac7b4f8e0b',\n", " 'HTTPStatusCode': 200,\n", - " 'HTTPHeaders': {'x-amzn-requestid': '6b81bad9-1f68-4b36-bf30-b194f5097a55',\n", + " 'HTTPHeaders': {'x-amzn-requestid': '510d5be0-0a1a-4daa-997a-12ac7b4f8e0b',\n", " 'content-type': 'application/x-amz-json-1.1',\n", " 'content-length': '85',\n", - " 'date': 'Tue, 24 Oct 2023 18:28:34 GMT'},\n", + " 'date': 'Thu, 26 Oct 2023 18:24:38 GMT'},\n", " 'RetryAttempts': 0}}" ] }, - "execution_count": 346, + "execution_count": 530, "metadata": {}, "output_type": "execute_result" } @@ -4233,7 +4290,7 @@ }, { "cell_type": "code", - "execution_count": 347, + "execution_count": 531, "id": "20dfbd97", "metadata": {}, "outputs": [], @@ -4391,7 +4448,7 @@ }, { "cell_type": "code", - "execution_count": 349, + "execution_count": 536, "id": "4ad4f1f2", "metadata": { "tags": [] @@ -4432,15 +4489,15 @@ " lambda_role_arn = response[\"Role\"][\"Arn\"]\n", "\n", " iam_client.attach_role_policy(\n", - " RoleName=\"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole\",\n", - " PolicyArn=lambda_role_arn,\n", + " PolicyArn=\"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole\",\n", + " RoleName=lambda_role_name,\n", " )\n", "\n", " iam_client.attach_role_policy(\n", - " RoleName=\"arn:aws:iam::aws:policy/AmazonSageMakerFullAccess\",\n", - " PolicyArn=lambda_role_arn,\n", + " RoleName=lambda_role_name,\n", + " PolicyArn=\"arn:aws:iam::aws:policy/AmazonSageMakerFullAccess\",\n", " )\n", - "\n", + " \n", " print(f'Role \"{lambda_role_name}\" created with ARN \"{lambda_role_arn}\".')\n", "except iam_client.exceptions.EntityAlreadyExistsException:\n", " print(f\"Role {lambda_role_name} already exists.\")\n",