def _image_to_head(self, is_training, reuse=None):
# Base bottleneck
assert (0 <= cfg.MOBILENET.FIXED_LAYERS <= 12)
net_conv = self._image
if cfg.MOBILENET.FIXED_LAYERS > 0:
with slim.arg_scope(mobilenet_v1_arg_scope(is_training=False)):
net_conv = mobilenet_v1_base(net_conv,
_CONV_DEFS[:cfg.MOBILENET.FIXED_LAYERS],
starting_layer=0,
depth_multiplier=self._depth_multiplier,
reuse=reuse,
scope=self._scope)
if cfg.MOBILENET.FIXED_LAYERS < 12:
with slim.arg_scope(mobilenet_v1_arg_scope(is_training=is_training)):
net_conv = mobilenet_v1_base(net_conv,
_CONV_DEFS[cfg.MOBILENET.FIXED_LAYERS:12],
starting_layer=cfg.MOBILENET.FIXED_LAYERS,
depth_multiplier=self._depth_multiplier,
reuse=reuse,
scope=self._scope)
self._act_summaries.append(net_conv)
self._layers['head'] = net_conv
return net_conv
评论列表
文章目录