我将从以下提供的预训练模型中微调一些图像模型:https ://github.com/tensorflow/models/tree/master/research/slim
这是微调脚本的模板:
$ 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} \
# Please notice the 2 lines below
--checkpoint_exclude_scopes=InceptionV3/Logits,InceptionV3/AuxLogits \
--trainable_scopes=InceptionV3/Logits,InceptionV3/AuxLogits
最后两行是我们要微调的层,上面的示例仅适用于 Inception 模型。
我想知道我们怎么知道这一层的确切名称InceptionV3/Logits
呢?如果我对 ResNet 进行微调,我应该在模板中输入哪个名称?有没有一种正式的方法来获取网络图,以便知道所有层的名称?