Commit 31559b69 authored by drpngx's avatar drpngx Committed by GitHub
Browse files

Merge pull request #556 from rohitgirdhar/slim_bug_tf11

Fix end point collection to return a dict
parents 1e982561 22e429a1
...@@ -117,7 +117,7 @@ def alexnet_v2(inputs, ...@@ -117,7 +117,7 @@ def alexnet_v2(inputs,
scope='fc8') scope='fc8')
# Convert end_points_collection into a end_point dict. # Convert end_points_collection into a end_point dict.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if spatial_squeeze: if spatial_squeeze:
net = tf.squeeze(net, [1, 2], name='fc8/squeezed') net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
end_points[sc.name + '/fc8'] = net end_points[sc.name + '/fc8'] = net
......
...@@ -110,7 +110,7 @@ def overfeat(inputs, ...@@ -110,7 +110,7 @@ def overfeat(inputs,
biases_initializer=tf.zeros_initializer, biases_initializer=tf.zeros_initializer,
scope='fc8') scope='fc8')
# Convert end_points_collection into a end_point dict. # Convert end_points_collection into a end_point dict.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if spatial_squeeze: if spatial_squeeze:
net = tf.squeeze(net, [1, 2], name='fc8/squeezed') net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
end_points[sc.name + '/fc8'] = net end_points[sc.name + '/fc8'] = net
......
...@@ -198,7 +198,7 @@ def resnet_v1(inputs, ...@@ -198,7 +198,7 @@ def resnet_v1(inputs,
net = slim.conv2d(net, num_classes, [1, 1], activation_fn=None, net = slim.conv2d(net, num_classes, [1, 1], activation_fn=None,
normalizer_fn=None, scope='logits') normalizer_fn=None, scope='logits')
# Convert end_points_collection into a dictionary of end_points. # Convert end_points_collection into a dictionary of end_points.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if num_classes is not None: if num_classes is not None:
end_points['predictions'] = slim.softmax(net, scope='predictions') end_points['predictions'] = slim.softmax(net, scope='predictions')
return net, end_points return net, end_points
......
...@@ -207,7 +207,7 @@ def resnet_v2(inputs, ...@@ -207,7 +207,7 @@ def resnet_v2(inputs,
net = slim.conv2d(net, num_classes, [1, 1], activation_fn=None, net = slim.conv2d(net, num_classes, [1, 1], activation_fn=None,
normalizer_fn=None, scope='logits') normalizer_fn=None, scope='logits')
# Convert end_points_collection into a dictionary of end_points. # Convert end_points_collection into a dictionary of end_points.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if num_classes is not None: if num_classes is not None:
end_points['predictions'] = slim.softmax(net, scope='predictions') end_points['predictions'] = slim.softmax(net, scope='predictions')
return net, end_points return net, end_points
......
...@@ -114,7 +114,7 @@ def vgg_a(inputs, ...@@ -114,7 +114,7 @@ def vgg_a(inputs,
normalizer_fn=None, normalizer_fn=None,
scope='fc8') scope='fc8')
# Convert end_points_collection into a end_point dict. # Convert end_points_collection into a end_point dict.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if spatial_squeeze: if spatial_squeeze:
net = tf.squeeze(net, [1, 2], name='fc8/squeezed') net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
end_points[sc.name + '/fc8'] = net end_points[sc.name + '/fc8'] = net
...@@ -173,7 +173,7 @@ def vgg_16(inputs, ...@@ -173,7 +173,7 @@ def vgg_16(inputs,
normalizer_fn=None, normalizer_fn=None,
scope='fc8') scope='fc8')
# Convert end_points_collection into a end_point dict. # Convert end_points_collection into a end_point dict.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if spatial_squeeze: if spatial_squeeze:
net = tf.squeeze(net, [1, 2], name='fc8/squeezed') net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
end_points[sc.name + '/fc8'] = net end_points[sc.name + '/fc8'] = net
...@@ -232,7 +232,7 @@ def vgg_19(inputs, ...@@ -232,7 +232,7 @@ def vgg_19(inputs,
normalizer_fn=None, normalizer_fn=None,
scope='fc8') scope='fc8')
# Convert end_points_collection into a end_point dict. # Convert end_points_collection into a end_point dict.
end_points = dict(tf.get_collection(end_points_collection)) end_points = slim.utils.convert_collection_to_dict(end_points_collection)
if spatial_squeeze: if spatial_squeeze:
net = tf.squeeze(net, [1, 2], name='fc8/squeezed') net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
end_points[sc.name + '/fc8'] = net end_points[sc.name + '/fc8'] = net
......
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