def _image_to_head(self, is_training, reuse=None):
assert (0 <= cfg.RESNET.FIXED_BLOCKS <= 3)
# Now the base is always fixed during training
with slim.arg_scope(resnet_arg_scope(is_training=False)):
net_conv = self._build_base()
if cfg.RESNET.FIXED_BLOCKS > 0:
with slim.arg_scope(resnet_arg_scope(is_training=False)):
net_conv, _ = resnet_v1.resnet_v1(net_conv,
self._blocks[0:cfg.RESNET.FIXED_BLOCKS],
global_pool=False,
include_root_block=False,
reuse=reuse,
scope=self._scope)
if cfg.RESNET.FIXED_BLOCKS < 3:
with slim.arg_scope(resnet_arg_scope(is_training=is_training)):
net_conv, _ = resnet_v1.resnet_v1(net_conv,
self._blocks[cfg.RESNET.FIXED_BLOCKS:-1],
global_pool=False,
include_root_block=False,
reuse=reuse,
scope=self._scope)
self._act_summaries.append(net_conv)
self._layers['head'] = net_conv
return net_conv
should it be assert (0 <= cfg.RESNET.FIXED_BLOCKS <= 4), if cfg.RESNET.FIXED_BLOCKS < 4: and self._blocks[cfg.RESNET.FIXED_BLOCKS:], ?
otherwise it will ignore the last block if our number of fixed blocks is 3
there are four conv blocks according to the residual net paper
In the file ../lib/net/resnet_v1.py
should it be
assert (0 <= cfg.RESNET.FIXED_BLOCKS <= 4)
,if cfg.RESNET.FIXED_BLOCKS < 4:
andself._blocks[cfg.RESNET.FIXED_BLOCKS:],
? otherwise it will ignore the last block if our number of fixed blocks is 3 there are four conv blocks according to the residual net paper