Skip to content

Commit

Permalink
updated fastai example
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcclean-aws committed Apr 29, 2019
1 parent 3acface commit fbbfd96
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 101 deletions.
4 changes: 1 addition & 3 deletions advanced_functionality/fastai_oxford_pets/daemon.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# fastai Lesson 1 - Oxford Pets example with Amazon SageMaker\n",
"# fastai: lesson 1 - Pets example with Amazon SageMaker\n",
"\n",
"## Pre-requisites\n",
"\n",
Expand All @@ -15,15 +15,6 @@
"**Note, you can only run a single local notebook at one time.**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!/bin/bash ./setup.sh"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -63,6 +54,22 @@
"- The IAM role arn used to give training and hosting access to your data. See the documentation for how to create these. Note, if more than one role is required for notebook instances, training, and/or hosting, please replace the sagemaker.get_execution_role() with appropriate full IAM role arn string(s)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you want to test your training or hosting of your fastai model then run the following cell to update the Docker daemon default shared memory to 2gb. Only run this command if you are using the `ml.p3.2xlarge` instance type."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"! sudo cp daemon.json /etc/docker/daemon.json && sudo pkill -SIGHUP dockerd"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -182,7 +189,7 @@
"\n",
"The `PyTorch` class allows us to run our training function on SageMaker. We need to configure it with our training script, an IAM role, the number of training instances, and the training instance type. \n",
"\n",
"For local training with GPU, we could set this to ```local_gpu```. In this case, `instance_type` was set above based on your whether you're running a GPU instance. If `instance_type` is set to a SageMaker instance type (e.g. ml.p2.xlarge) then the training will happen on SageMaker.\n",
"For local training with GPU, we could set this to ```local_gpu```. In this case, `instance_type` was set below based on whether you're running a GPU instance. If `instance_type` is set to a SageMaker instance type (e.g. ml.p2.xlarge) then the training will happen on SageMaker.\n",
"\n",
"The parameter `data_location` determines where the training data is. If training locally then it can be set to the local file system to avoid having to download from S3. If training on SageMaker then it needs to reference the training data on S3.\n",
"\n",
Expand Down Expand Up @@ -352,20 +359,13 @@
"source": [
"pets_estimator.delete_endpoint()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "conda_pytorch_p36",
"language": "python",
"name": "fastai"
"name": "conda_pytorch_p36"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -377,7 +377,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.6.5"
},
"notice": "Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."
},
Expand Down
77 changes: 0 additions & 77 deletions advanced_functionality/fastai_oxford_pets/setup.sh

This file was deleted.

0 comments on commit fbbfd96

Please sign in to comment.