Project code for Udacity's AI Programming with Python Nanodegree program. In this project, students first develop code for an image classifier built with PyTorch, then convert it into a command line application.
Note: This is an edited version after project submission, contents may not follow project rubric. And the main objective of this edited version is to explore the use of Git, GitHub and Google Colab, hence the training epoch use is 1 just to ensure the model is working.
Dataset use for training -
Download split dataset
Steps:
flower_data
to flowers
flowers
folder to the same directory where these programmes are stored.Build and train a model, using command line:
Default arguments
$ python3 train.py
# or
$ python3 train.py --arch --hidden_units --learning_rate --epochs
Specified arguments
$ python3 train.py --arch vgg16 --hidden_units 4096 --learning_rate 0.01 --epochs 1
Rebuild trained model and predict, using command line:
Default arguments
$ python3 predict.py
# or
$ python3 predict.py --topk
Specified arguments
$ python3 predict.py --topk 5
Alternatively, use Image Classifier Project-test20.ipynb to train and predict in one file.
MIT License