警告:变量在检查点中不可用
Warning: variable is not available in checkpoint
我正在为 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
是的,可以使用来自 here 的预训练模型。可以从 variable_names_map 中检查需要初始化哪些变量以及从加载的检查点可以使用哪些变量。从那里,select 变量并初始化以进一步微调。
主要在 utils/variables_helper.py 文件中需要对 Tensorflow 的代码进行一些修改。
FasterRCNN 的 FirstStage 和 SecondStage 中的内容在 faster_rcnn_mobilenet_v1_feature_extractor.py
中决定
我正在为 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
是的,可以使用来自 here 的预训练模型。可以从 variable_names_map 中检查需要初始化哪些变量以及从加载的检查点可以使用哪些变量。从那里,select 变量并初始化以进一步微调。
主要在 utils/variables_helper.py 文件中需要对 Tensorflow 的代码进行一些修改。
FasterRCNN 的 FirstStage 和 SecondStage 中的内容在 faster_rcnn_mobilenet_v1_feature_extractor.py
中决定