警告:检查点中没有变量

问题描述 投票:0回答:1

我正在为MobileNetV1培训FasterRCNN。

This model zoos没有针对MobileNetV1的FasterRCNN预先训练的模型。

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

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

我的问题是为什么我不能将这些预训练的权重用于更快的RCNN。

在这个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
python tensorflow object-detection-api
1个回答
0
投票

是的,可以使用来自here的预训练模型。可以从variable_names_map检查初始化所需的变量以及加载的检查点可用的变量。从那里,选择变量并初始化以进一步微调。

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

在FasterRCNN的FirstStage和SecondStage中的内容由faster_rcnn_mobilenet_v1_feature_extractor.py决定

© www.soinside.com 2019 - 2024. All rights reserved.