2024-04-26 03:35:25 发布
网友
我使用Google新的Tensorflow对象检测API来训练我自己的数据集,只有一个类。使用所有的默认参数可以正常工作,所以我想测试我的模型的性能,如果我减少一些(可能是所有)层中的过滤器数量。我的问题是如何减少现有ssd_mobile_v1模型层的过滤器?在
ssd_mobile_v1
通过减少配置中的depth_multiplier标量(位于feature_extractor标题下),可以修改所有层的过滤器数量。在
depth_multiplier
feature_extractor
或者,您可以通过修改相关feature提取器模块中的feature_map_layout来指定为本地化/分类层提供特征映射的各个层中的过滤器数量。在
feature_map_layout
对于您的示例,您将修改object_detection.models.ssd_mobilenet_v1_feature_extractor.py模块并更改layer_depth。默认值如下所示。在
object_detection.models.ssd_mobilenet_v1_feature_extractor.py
layer_depth
feature_map_layout = { 'from_layer': ['Conv2d_11_pointwise', 'Conv2d_13_pointwise', '', '', '', ''], 'layer_depth': [-1, -1, 512, 256, 256, 128], 'use_explicit_padding': self._use_explicit_padding, 'use_depthwise': self._use_depthwise, }
一个更好的选择是创建您自己的feature提取器模块,确保它被导入到object_detection.builders.model_builder.py中,并在您的配置中修改feature_extractor头下的type。在
object_detection.builders.model_builder.py
type
通过减少配置中的
depth_multiplier
标量(位于feature_extractor
标题下),可以修改所有层的过滤器数量。在或者,您可以通过修改相关feature提取器模块中的
feature_map_layout
来指定为本地化/分类层提供特征映射的各个层中的过滤器数量。在对于您的示例,您将修改
object_detection.models.ssd_mobilenet_v1_feature_extractor.py
模块并更改layer_depth
。默认值如下所示。在一个更好的选择是创建您自己的feature提取器模块,确保它被导入到
object_detection.builders.model_builder.py
中,并在您的配置中修改feature_extractor
头下的type
。在相关问题 更多 >
编程相关推荐