【发布时间】:2020-02-23 20:25:03
【问题描述】:
我正在尝试重新训练 SSD 模型以检测一类自定义对象(吉他)。
我正在使用 ssd_mobilenet_v1_coco 模型,其中包含从 OpenImage 数据集下载的 1000K 预标记图像的数据集。
我指的是this answer,以尝试改进对图像中小物体的检测。
按照那里的建议,我想在已经存在的特征图上添加一个额外的特征图 (Conv2d_5_pointwise),因此总共有 7 个特征图。所以,我这样修改了“models/ssd_mobilenet_v1_feature_extractor.py”:
feature_map_layout = {
'from_layer': ['Conv2d_5_pointwise','Conv2d_11_pointwise', 'Conv2d_13_pointwise', '', '',
'', ''][:self._num_layers],
'layer_depth': [-1, -1, -1, 512, 256, 256, 128][:self._num_layers],
'use_explicit_padding': self._use_explicit_padding,
'use_depthwise': self._use_depthwise,
}
因此,我也将配置文件中的 num_layers 更改为 7。
anchor_generator {
ssd_anchor_generator {
num_layers: 7
min_scale: 0.2
max_scale: 0.95
aspect_ratios: 1.0
aspect_ratios: 2.0
aspect_ratios: 0.5
aspect_ratios: 3.0
aspect_ratios: 0.3333
}
}
但是,当尝试使用 main_model.py 训练模型时,我收到错误消息
File "/home/carlo/projects/tf_models/research/object_detection/core/anchor_generator.py", line 105, in generate
raise ValueError('Number of feature maps is expected to equal the length '
ValueError: Number of feature maps is expected to equal the length of `num_anchors_per_location`.
我是否应该修改其他任何内容以使其正常工作? 谢谢!
【问题讨论】:
标签: python tensorflow object-detection object-detection-api mobilenet