|
111 | 111 | "metadata": {},
|
112 | 112 | "outputs": [],
|
113 | 113 | "source": [
|
114 |
| - "# Get S3 URI of the model artifact\n", |
115 |
| - "s3_client = boto3.client('s3')\n", |
116 |
| - "model_dir = s3_client.list_objects_v2(Bucket=bucket, Delimiter='/', Prefix=f'{prefix}/{prefix}')['CommonPrefixes'][-1]['Prefix']\n", |
117 |
| - "bird_model_path = f's3://{bucket}/{model_dir}output/model.tar.gz'\n", |
| 114 | + "bird_model_path = f's3://{bucket}/{prefix}/outputs/model/model.tar.gz'\n", |
118 | 115 | "print(f'bird_model_path: {bird_model_path}')"
|
119 | 116 | ]
|
120 | 117 | },
|
|
175 | 172 | },
|
176 | 173 | {
|
177 | 174 | "cell_type": "code",
|
178 |
| - "execution_count": null, |
| 175 | + "execution_count": 5, |
179 | 176 | "metadata": {},
|
180 |
| - "outputs": [], |
| 177 | + "outputs": [ |
| 178 | + { |
| 179 | + "name": "stdout", |
| 180 | + "output_type": "stream", |
| 181 | + "text": [ |
| 182 | + "---!Endpoint [tensorflow-inference-2022-11-06-20-50-11-918] deployed\n" |
| 183 | + ] |
| 184 | + } |
| 185 | + ], |
181 | 186 | "source": [
|
182 | 187 | "from sagemaker.tensorflow import TensorFlowModel\n",
|
183 | 188 | "\n",
|
|
223 | 228 | "cell_type": "code",
|
224 | 229 | "execution_count": null,
|
225 | 230 | "metadata": {},
|
226 |
| - "outputs": [], |
| 231 | + "outputs": [ |
| 232 | + { |
| 233 | + "name": "stderr", |
| 234 | + "output_type": "stream", |
| 235 | + "text": [ |
| 236 | + "update_endpoint is a no-op in sagemaker>=2.\n", |
| 237 | + "See: https://sagemaker.readthedocs.io/en/stable/v2.html for details.\n" |
| 238 | + ] |
| 239 | + }, |
| 240 | + { |
| 241 | + "name": "stdout", |
| 242 | + "output_type": "stream", |
| 243 | + "text": [ |
| 244 | + "-" |
| 245 | + ] |
| 246 | + } |
| 247 | + ], |
227 | 248 | "source": [
|
228 | 249 | "from sagemaker.tensorflow import TensorFlowModel\n",
|
229 | 250 | "\n",
|
|
347 | 368 | " cv_utils.predict_bird_from_file(inputfile,predictor,possible_classes)"
|
348 | 369 | ]
|
349 | 370 | },
|
350 |
| - { |
351 |
| - "cell_type": "markdown", |
352 |
| - "metadata": {}, |
353 |
| - "source": [ |
354 |
| - "## Clean Up" |
355 |
| - ] |
356 |
| - }, |
357 | 371 | {
|
358 | 372 | "cell_type": "code",
|
359 | 373 | "execution_count": null,
|
|
367 | 381 | "kernelspec": {
|
368 | 382 | "display_name": "Python 3 (Data Science)",
|
369 | 383 | "language": "python",
|
370 |
| - "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-east-1:081325390199:image/datascience-1.0" |
| 384 | + "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:eu-west-1:470317259841:image/datascience-1.0" |
371 | 385 | },
|
372 | 386 | "language_info": {
|
373 | 387 | "codemirror_mode": {
|
|
0 commit comments