Fine-tuning a model from an existing checkpoint with TensorFlow-Slim 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.
You can get all information you need from the source code.


train_dir: Directory where checkpoints and event logs are written to. (default: /tmp/tfmodel/)
dataset_dir: The directory where the dataset files are stored.
dataset_name: The name of the dataset to load. (default: imagenet)
dataset_split_name: The name of the train/test split. (default: train)
model_name: The name of the architecture to train. (default: inception_v3)
checkpoint_path: The path to a checkpoint from which to fine-tune.
checkpoint_exclude_scopes: Comma-separated list of scopes of variables to exclude when restoring from a checkpoint.
trainable_scopes: Comma-separated list of scopes to filter the set of variables to train. By default, None would train all the variables.