我正在尝试使用TensorFlow-Slim使用新的图像数据集重新训练预训练模型的最后一层。
假设我想在鲜花数据集上微调 inception-v3。Inception_v3 在具有 1000 个类别标签的 ImageNet 上进行训练,但鲜花数据集只有 5 个类别。由于数据集非常小,我们将只训练新层。
官方 tf github 页面上的示例显示了如何执行此操作:
$ 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
我无法完全理解上述代码中的所有参数:
train_dir= ?
dataset_dir= 新数据集目录位置
dataset_name= 数据集的名称(但为什么?)
dataset_split_name= ?
model_name=我们要训练的模型的名称
checkpoint_path= 模型检查点的路径
checkpoint_exclude_scopes= ?
trainable_scopes= ?
如果我对任何参数有误,请帮我弄清楚这些参数的含义并纠正我?
注意:我知道我们可以使用tensorflow 官方网站上提到的方法重新训练 inception_v3,但我想对 tensorflow-slim 做同样的事情。