Skip to content

Commit 15a1a41

Browse files
authored
Merge pull request #31 from maxisme/master
Fix TypeError and TensorFlow naming convention.
2 parents 1672fbb + 7cca194 commit 15a1a41

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

nets/resnet_v1_101.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ def endpoints(image, is_training):
1414
_, endpoints = resnet_v1_101(image, num_classes=None, is_training=is_training, global_pool=True)
1515

1616
endpoints['model_output'] = endpoints['global_pool'] = tf.reduce_mean(
17-
endpoints['resnet_v1_101/block4'], [1, 2], name='pool5', keep_dims=False)
17+
endpoints['resnet_v1_101/block4'], [1, 2], name='pool5')
1818

1919
return endpoints, 'resnet_v1_101'

nets/resnet_v1_50.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ def endpoints(image, is_training):
1414
_, endpoints = resnet_v1_50(image, num_classes=None, is_training=is_training, global_pool=True)
1515

1616
endpoints['model_output'] = endpoints['global_pool'] = tf.reduce_mean(
17-
endpoints['resnet_v1_50/block4'], [1, 2], name='pool5', keep_dims=False)
17+
endpoints['resnet_v1_50/block4'], [1, 2], name='pool5')
1818

1919
return endpoints, 'resnet_v1_50'

train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def sample_k_fids_for_pid(pid, all_fids, all_pids, batch_k):
151151
# create a padded list of indices which contain a multiple of the
152152
# original FID count such that all of them will be sampled equally likely.
153153
count = tf.shape(possible_fids)[0]
154-
padded_count = tf.cast(tf.ceil(batch_k / count), tf.int32) * count
154+
padded_count = tf.cast(tf.ceil(batch_k / tf.cast(count, tf.float32)), tf.int32) * count
155155
full_range = tf.mod(tf.range(padded_count), count)
156156

157157
# Sampling is always performed by shuffling and taking the first k.

0 commit comments

Comments
 (0)