Skip to content

Commit 07ae0c9

Browse files
Merge pull request #9 from absynthe/refactor/02refactor
refactor: minor 02 refactor
2 parents b1e9ac3 + 2e617a5 commit 07ae0c9

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

02_training/training.ipynb

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"cell_type": "code",
21-
"execution_count": 56,
21+
"execution_count": null,
2222
"metadata": {},
2323
"outputs": [],
2424
"source": [
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"cell_type": "code",
42-
"execution_count": 57,
42+
"execution_count": null,
4343
"metadata": {},
4444
"outputs": [],
4545
"source": [
@@ -70,7 +70,7 @@
7070
},
7171
{
7272
"cell_type": "code",
73-
"execution_count": 58,
73+
"execution_count": null,
7474
"metadata": {},
7575
"outputs": [],
7676
"source": [
@@ -84,7 +84,7 @@
8484
},
8585
{
8686
"cell_type": "code",
87-
"execution_count": 59,
87+
"execution_count": null,
8888
"metadata": {},
8989
"outputs": [],
9090
"source": [
@@ -103,10 +103,8 @@
103103
"estimator = TensorFlow(\n",
104104
" entry_point=\"train-mobilenet.py\",\n",
105105
" source_dir=\"code\",\n",
106-
" output_path=model_path, \n",
107106
" instance_type=training_instance_type,\n",
108107
" instance_count=training_instance_count, \n",
109-
" distribution=distribution,\n",
110108
" hyperparameters=shared_hyperparameters, \n",
111109
" metric_definitions=metric_definitions, \n",
112110
" role=role,\n",
@@ -179,27 +177,13 @@
179177
},
180178
{
181179
"cell_type": "code",
182-
"execution_count": 55,
180+
"execution_count": null,
183181
"metadata": {},
184-
"outputs": [
185-
{
186-
"name": "stdout",
187-
"output_type": "stream",
188-
"text": [
189-
"\n",
190-
"2022-11-03 14:07:17 Starting - Preparing the instances for training\n",
191-
"2022-11-03 14:07:17 Downloading - Downloading input data\n",
192-
"2022-11-03 14:07:17 Training - Training image download completed. Training in progress.\n",
193-
"2022-11-03 14:07:17 Uploading - Uploading generated training model\n",
194-
"2022-11-03 14:07:17 Completed - Resource reused by training job: cv-hpo-221103-1357-004-4196ca7b\n",
195-
"Best model artifact file is uploaded here: s3://sagemaker-us-east-1-379642174303/postprocessing/cv-hpo-221103-1357-002-0901bc7e/output ========\n"
196-
]
197-
}
198-
],
182+
"outputs": [],
199183
"source": [
200-
"training_job_name = tuner.best_estimator().latest_training_job.name\n",
184+
"best_model_uri = tuner.best_estimator().latest_training_job.describe()['ModelArtifacts']['S3ModelArtifacts']\n",
201185
"\n",
202-
"print(f\"Best model artifact file is uploaded here: {model_path}/{training_job_name}/output ========\")\n"
186+
"print(f\"\\nBest model artifact file is uploaded here: {best_model_uri}\")"
203187
]
204188
}
205189
],
@@ -208,7 +192,7 @@
208192
"kernelspec": {
209193
"display_name": "Python 3 (Data Science)",
210194
"language": "python",
211-
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-east-1:081325390199:image/datascience-1.0"
195+
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:eu-west-1:470317259841:image/datascience-1.0"
212196
},
213197
"language_info": {
214198
"codemirror_mode": {

0 commit comments

Comments
 (0)