I'm trying to retrain the final layer of a pretrained model with a new image dataset using TensorFlow-Slim.
Lets say I want to fine-tuning inception-v3 on flowers dataset. Inception_v3 was trained on ImageNet with 1000 class labels, but the flowers dataset only have 5 classes. Since the dataset is quite small we will only train the new layers.
An example at official tf github page shows how to do it:
$ DATASET_DIR=/tmp/flowers
$ TRAIN_DIR=/tmp/flowers-models/inception_v3
$ CHECKPOINT_PATH=/tmp/my_checkpoints/inception_v3.ckpt
$ python train_image_classifier.py \
--train_dir=${TRAIN_DIR} \
--dataset_dir=${DATASET_DIR} \
--dataset_name=flowers \
--dataset_split_name=train \
--model_name=inception_v3 \
--checkpoint_path=${CHECKPOINT_PATH} \
--checkpoint_exclude_scopes=InceptionV3/Logits,InceptionV3/AuxLogits/Logits \
--trainable_scopes=InceptionV3/Logits,InceptionV3/AuxLogits/Logits
I couldn't fully understand all the parameters in the above code:
train_dir
= ?
dataset_dir
= new dataset directory location
dataset_name
= name of the dataset (but why ? )
dataset_split_name
= ?
model_name
= name of the model on which we want to train
checkpoint_path
= path to the model checkpoint
checkpoint_exclude_scopes
= ?
trainable_scopes
= ?
Help me figure out what these parameter means and correct me if I'm wrong about any of the parameter?
Note: I'm aware that we can retrain inception_v3 with a method mentioned at official tensorflow website but I want to do the same with tensorflow-slim.