Skip to content

Commit 34c5ad1

Browse files
committed
Internal change
PiperOrigin-RevId: 299205720
1 parent 84a0fa0 commit 34c5ad1

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

examples/slim/BUILD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Description:
22
# Contains files for loading, training and evaluating TF-Slim-based models.
33

4+
load("//devtools/python/blaze:python3.bzl", "py2and3_test")
5+
46
package(
57
default_visibility = ["//visibility:public"],
68
)
@@ -706,16 +708,16 @@ py_library(
706708
],
707709
)
708710

709-
py_test(
711+
py2and3_test(
710712
name = "resnet_v1_test",
711713
size = "medium",
712714
srcs = ["nets/resnet_v1_test.py"],
713-
python_version = "PY2",
714715
shard_count = 2,
715716
srcs_version = "PY2AND3",
716717
deps = [
717718
":resnet_utils",
718719
":resnet_v1",
720+
"//third_party/py/six",
719721
# "//numpy",
720722
# "//tensorflow",
721723
],

examples/slim/nets/resnet_v1_test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
from __future__ import division
1919
from __future__ import print_function
2020

21-
import numpy as np
22-
import tensorflow as tf
23-
2421
from nets import resnet_utils
2522
from nets import resnet_v1
23+
import numpy as np
24+
from six.moves import range
25+
from six.moves import zip
26+
import tensorflow as tf
2627

2728
slim = tf.contrib.slim
2829

@@ -185,7 +186,7 @@ def testEndPointsV1(self):
185186
'tiny/block2/unit_2/bottleneck_v1/conv1',
186187
'tiny/block2/unit_2/bottleneck_v1/conv2',
187188
'tiny/block2/unit_2/bottleneck_v1/conv3']
188-
self.assertItemsEqual(expected, end_points.keys())
189+
self.assertItemsEqual(expected, list(end_points.keys()))
189190

190191
def _stack_blocks_nondense(self, net, blocks):
191192
"""A simplified ResNet Block stacker without output stride control."""
@@ -392,7 +393,7 @@ def testEndpointNames(self):
392393
expected.append('resnet/block%d' % block)
393394
expected.extend(['global_pool', 'resnet/logits', 'resnet/spatial_squeeze',
394395
'predictions'])
395-
self.assertItemsEqual(end_points.keys(), expected)
396+
self.assertItemsEqual(list(end_points.keys()), expected)
396397

397398
def testClassificationShapes(self):
398399
global_pool = True

0 commit comments

Comments
 (0)