Trains sequential Keras model on Skin Cancer MNIST: HAM10000 dataset from Kaggle. Training supports local machine and AI Platfrom.
notebooks
: Exploratory Jupyter notebooksscripts
: Bash scripts for local and cloud trainingtrainer
: AI platform trainer modulemodel.py
: Defines a Keras model and input function for trainingtask.py
: Trains a Keras model to predict cancer classutil.py
: Utilities to download and preprocess data
First, install the requirements.
pip install -r requirements.txt
To start training either locally or on AI Platfro you need to create an environment variable called KAGGLE_KEY
which has to point to a json file containing your Kaggle API key. For more information about how to generate and download your API key from Kaggle, visit the Kaggle API Github page.
export KAGGLE_KEY="path/to/my/kaggle.json"
To train the Keras model locally, run train-local.sh
.
sh scripts/train-local.sh
If you'd like to update the training parameters, edit train-local.sh
file and add your desired values.
To train the Keras model on AI Platform, you need to create a Google Cloud project. For more information on how to create a project on Google Cloud Platform, visit the documentation.
Next, create a Storage bucket where you can store all the logs, checkpoints and SavedModels. Set the name of the bucket as environment variable.
export BUCKET_NAME="my-bukcet-name"
Enable the AI Platform API in your projects. After that you are all set to run train.sh
.
sh scripts/train.sh