This is a full project of imageclassification using a resnet18 pretrained model with sagemaker as Udacity's ML Nanodegree Project. The project was completed by making good use of the tools available to a machine learning engineer. the tools used are the Pytorch framework, a pretrained model, debgger, together with the model to train and deploy and endpoint.
The Python script used as entry points include: hpo.py script was used for hperparameter tuning after which the best sets of hypermaters were used in training
train_model.py script was used to perform model profiling and debugging. The function required for debugging was stated
reference.py script used as entry point for model deployment makes it possible for data(image) to be passed to the endpoint for testing
We use the provided Dog Breed Dataset to use as data for the training jobs
The notebook environment is prepared by installing all the required dependencies, the dataset is downloaded, unziped and loaded to S3 Training
For this project, I used ResNet18 model. Among other pre-trained models, ResNet(18) model is popularly used and it is suitable for the system i am using. It provides a fair balance between the model accuracy to the number of operations needed to excecute. Though ResNet18 model might tend to have a lower accuracy, It is comparably faster to train with than ResNet 34 completed training job. i also used epoch 50.
Log metrics of the training process
The two parameters tuned where the batch size and learning rate
The Debugger Hook was set to record the Loss Criterion of the process in both training and validation/testing.
After successfully carrying out the training job with the best hyperparameter available, I called for deployment with pytorch_model.deploy(). I also run a prediction on the endpoint.