Training on AWS with the provided dataset should take about 2 hours and cost roughly $1. If you add more images or add new labeling classes the cost and time will be higher.
Train with AWS¶
If you are not in the AWS Console main page, click the AWS logo in the top left if you’re logged in, or go to the page through your awseducate.com classroom if you are not logged in.
Search “SageMaker” in the “Find Services” field and create a new SageMaker notebook instance.
Notebook instance name: Give your notebook a name
IAM Role: Click Create a new role inside of the dropdown. Let it have access to Any S3 bucket.
Git repositories: open the panel, then click on where it says None. Click Clone a public Git repository to this notebook instance only, then paste in this link: https://github.com/wpilibsuite/DetectCoral.git
Create the instance
After several minutes, the notebook will be “In Service”. Open the notebook using the JupyterLab option.
DetectCoralfolder, and then
training.ipynb, found on the left side of the screen. We’ve noticed that the first time a notebook is opened that it doesn’t work correctly. To fix this, follow these steps:
Reload the tab. Dismiss the error. When prompted, select the kernel
If the tab does not finish reloading, close the tab, and open the notebook in JupyterLab once again. It will work this time.
estimator.fit(s3://<<your-bucket-name>>). If you could not access Supervisely in earlier steps, do not replace the bucket’s name.
Run the code block by clicking the play button at the top of your screen. This block could take up to two hours to train your model depending on the value of
Once the code block finishes running, the precision for each epoch is outputted. More information about what precision means can be found in Understanding Precision.
Go back to SageMaker. Open
Training jobson the far left. Open the most recent training job.
Once the model is done training (the job says
Completed), scroll to the bottom inside the training job. Click on the link in the
Outputsection, where it says
S3 model artifact.
model.tar.gz. Click on
Stop the notebook now that the training job is completed. Do this by going back to the SageMaker tab, clicking on
Notebook instanceson the far left, selecting the instance that is no longer needed, and selecting
Actions -> Stop.