使用slim的预训练模型训练ssd inception_v3

2024-04-27 20:48:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用对象检测API和SLIM(link)中的预训练模型来训练ssd初始v3模型 我尝试使用config来训练对象检测ssd inception v3模型:

model {
  ssd {
    num_classes: 1
    image_resizer {
      fixed_shape_resizer {
        height: 240
        width: 320
      }
    }
    feature_extractor {
      type: "ssd_inception_v3"
      depth_multiplier: 1.0
      min_depth: 16
      conv_hyperparams {
        regularizer {
          l2_regularizer {
            weight: 3.99999989895e-05
          }
        }
        initializer {
          truncated_normal_initializer {
            mean: 0.0
            stddev: 0.0299999993294
          }
        }
        activation: RELU_6
        batch_norm {
          decay: 0.999700009823
          center: true
          scale: true
          epsilon: 0.0010000000475
          train: true
        }
      }
      override_base_feature_extractor_hyperparams: true
    }
...

我在创建文件后停止了进程型号.ckpt-0.*,加载并打印所有张量的名称。在

之后,我使用

^{pr2}$

当我比较输出时,我没有看到ssdcepetionv3模型有很多层。例如:

InceptionV3/AuxLogits/Conv2d_2a_5x5/weights InceptionV3/Mixed_7c/Branch_3/Conv2d_0b_1x1/weight

在ssd_inception_v3的模型中,我看到5c之前的混合层

在SSD_inception和SLIM模型中,特征提取器有什么不同?在一般情况下,对于权重较轻的对象,在API中进行检测是可能的。在


Tags: 对象模型apitruev3featureresizerextractor
1条回答
网友
1楼 · 发布于 2024-04-27 20:48:12

{你可以看到^发生了什么。 它使用来自inception_v3.inception_v3_base(注意_base)的InceptionV3的“Mixed_5d”、“Mixed\u6e”、“Mixed_7c”的输出,并创建3个额外的具有512、256、128个通道的特征映射(这种情况发生在feature_map_generators.multi_resolution_feature_mapsby feature_map_layout)中。 为检测模型加载分类器的权重可以通过配置完成:

train_config{
    ...
    fine_tune_checkpoint: <path_to_inception_checkpoint>
    fine_tune_checkpoint_type: "classification"
}

当然,检查点必须与您使用的模型相匹配,例如ssd_inception_v3。在

相关问题 更多 >