警告:变量在检查点中不可用

时间:2019-03-15 07:33:08

标签: python tensorflow object-detection-api

我正在为MobileNetV1训练FasterRCNN。

This model zoos没有用于MobileNetV1的FasterRCNN的预训练模型。

所以我使用了here中的预训练模型。

但是我有错误,因为变量在检查点中不可用。 很多警告,我展示了其中一些。 这些是警告,但训练仍可以在没有预先训练的重量的情况下进行。

我的查询是为什么我不能在FasterRCNN中使用这些预训练的权重。

在此tutorial中,它在中间被称为"We typically initialize the weights of this feature extractor using those from the Slim Resnet-101 classification checkpoint, and we know that images were preprocessed when training this checkpoint by subtracting a channel mean from each input image. Thus, we implement the preprocess function to replicate the same channel mean subtraction behavior."

为什么我不能使用那些砝码?

我将配置好的模型加载为配置文件

fine_tune_checkpoint: "object_detection/data/mobilenet_v1_1.0_224/mobilenet_v1_1.0_224.ckpt"
from_detection_checkpoint: true

警告是

WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/BatchNorm/moving_variance] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_0/weights] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_depthwise/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_depthwise/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_depthwise/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_depthwise/BatchNorm/moving_variance] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_depthwise/depthwise_weights] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_pointwise/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_pointwise/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_pointwise/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_pointwise/BatchNorm/moving_variance] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_10_pointwise/weights] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_depthwise/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_depthwise/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_depthwise/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_depthwise/BatchNorm/moving_variance] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_depthwise/depthwise_weights] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_pointwise/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_pointwise/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_pointwise/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FirstStageFeatureExtractor/MobilenetV1/Conv2d_11_pointwise/BatchNorm/moving_variance] is not available in checkpoint

1 个答案:

答案 0 :(得分:0)

是的,可以使用here中的预训练模型。可以从variable_names_map中检查需要初始化哪些变量以及可以从加载的检查点获得哪些变量。从那里选择变量,然后初始化以进行进一步的微调。

主要在utils / variables_helper.py文件中,需要对Tensorflow的代码进行一些修改。

要在FasterRCNN的FirstStage和SecondStage中确定什么,要在fast_rcnn_mobilenet_v1_feature_extractor.py中确定