Skip to content

refactor: minor 02 refactor #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions 02_training/training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 56,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 58,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -84,7 +84,7 @@
},
{
"cell_type": "code",
"execution_count": 59,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -103,10 +103,8 @@
"estimator = TensorFlow(\n",
" entry_point=\"train-mobilenet.py\",\n",
" source_dir=\"code\",\n",
" output_path=model_path, \n",
" instance_type=training_instance_type,\n",
" instance_count=training_instance_count, \n",
" distribution=distribution,\n",
" hyperparameters=shared_hyperparameters, \n",
" metric_definitions=metric_definitions, \n",
" role=role,\n",
Expand Down Expand Up @@ -179,27 +177,13 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"2022-11-03 14:07:17 Starting - Preparing the instances for training\n",
"2022-11-03 14:07:17 Downloading - Downloading input data\n",
"2022-11-03 14:07:17 Training - Training image download completed. Training in progress.\n",
"2022-11-03 14:07:17 Uploading - Uploading generated training model\n",
"2022-11-03 14:07:17 Completed - Resource reused by training job: cv-hpo-221103-1357-004-4196ca7b\n",
"Best model artifact file is uploaded here: s3://sagemaker-us-east-1-379642174303/postprocessing/cv-hpo-221103-1357-002-0901bc7e/output ========\n"
]
}
],
"outputs": [],
"source": [
"training_job_name = tuner.best_estimator().latest_training_job.name\n",
"best_model_uri = tuner.best_estimator().latest_training_job.describe()['ModelArtifacts']['S3ModelArtifacts']\n",
"\n",
"print(f\"Best model artifact file is uploaded here: {model_path}/{training_job_name}/output ========\")\n"
"print(f\"\\nBest model artifact file is uploaded here: {best_model_uri}\")"
]
}
],
Expand All @@ -208,7 +192,7 @@
"kernelspec": {
"display_name": "Python 3 (Data Science)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-east-1:081325390199:image/datascience-1.0"
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:eu-west-1:470317259841:image/datascience-1.0"
},
"language_info": {
"codemirror_mode": {
Expand Down