我正在按照这个教程进行操作。
我使用的是Oxford-IIIT Pet数据和类似于这个的配置文件。
在pipeline_config文件中,我指定了微调检查点如下:
fine_tune_checkpoint: "{PATH TO}/ssd_mobilenet_v1_coco_11_06_2017/model.ckpt"
from_detection_checkpoint: false
但是当我运行,python object_detection/train.py … –train_dir=${PATH_TO_TRAIN_DIR}
我得到了一系列警告。
WARNING:root:变量 [MobilenetV1/Conv2d_0/BatchNorm/beta] 在检查点中不可用。
.
.
.
WARNING:root:变量 [MobilenetV1/Conv2d_9_pointwise/weights] 在检查点中不可用
并且程序退出时显示
ValueError: 没有变量可保存
我已经在Python中检查了ckpt,使用
print_tensors_in_checkpoint_file('{PATH TO}/ssd_mobilenet_v1_coco_11_06_2017/model.ckpt/model.ckpt', '',"")
输出是一列列表。
FeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta (DT_FLOAT) [32]
.
.
.
FeatureExtractor/MobilenetV1/Conv2d_9_pointwise/weights (DT_FLOAT) [1,1,512,512]
注意:当在pipeline配置文件中通过
from_detection_checkpoint: true
禁用finetune_checkpoint时,训练脚本运行正常
回答:
设置from_detection_checkpoint: true
实际上是您使用的检查点文件所必需的,因为该模型是作为检测器训练的(所以没有任何东西被禁用)。
只有当您想从预训练用于Imagenet分类的Slim模型开始训练时,才会设置from_detection_checkpoint: false
。