Commit 96845c19 authored by Jeremy Lewi's avatar Jeremy Lewi Committed by Sergio Guadarrama
Browse files

Add an option to make auxilary logits optional in inception v3. (#1862)

parent 3d97b007
...@@ -425,6 +425,7 @@ def inception_v3(inputs, ...@@ -425,6 +425,7 @@ def inception_v3(inputs,
prediction_fn=slim.softmax, prediction_fn=slim.softmax,
spatial_squeeze=True, spatial_squeeze=True,
reuse=None, reuse=None,
create_aux_logits=True,
scope='InceptionV3'): scope='InceptionV3'):
"""Inception model from http://arxiv.org/abs/1512.00567. """Inception model from http://arxiv.org/abs/1512.00567.
...@@ -457,6 +458,7 @@ def inception_v3(inputs, ...@@ -457,6 +458,7 @@ def inception_v3(inputs,
of shape [B, 1, 1, C], where B is batch_size and C is number of classes. of shape [B, 1, 1, C], where B is batch_size and C is number of classes.
reuse: whether or not the network and its variables should be reused. To be reuse: whether or not the network and its variables should be reused. To be
able to reuse 'scope' must be given. able to reuse 'scope' must be given.
create_aux_logits: Whether to create the auxiliary logits.
scope: Optional variable_scope. scope: Optional variable_scope.
Returns: Returns:
...@@ -481,6 +483,7 @@ def inception_v3(inputs, ...@@ -481,6 +483,7 @@ def inception_v3(inputs,
depth_multiplier=depth_multiplier) depth_multiplier=depth_multiplier)
# Auxiliary Head logits # Auxiliary Head logits
if create_aux_logits:
with slim.arg_scope([slim.conv2d, slim.max_pool2d, slim.avg_pool2d], with slim.arg_scope([slim.conv2d, slim.max_pool2d, slim.avg_pool2d],
stride=1, padding='SAME'): stride=1, padding='SAME'):
aux_logits = end_points['Mixed_6e'] aux_logits = end_points['Mixed_6e']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment