Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
b37c3fc1
Commit
b37c3fc1
authored
Dec 18, 2019
by
Jaehong Kim
Committed by
A. Unique TensorFlower
Dec 18, 2019
Browse files
Recover global policy between tests.
PiperOrigin-RevId: 286139970
parent
8f4bf01f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
official/vision/image_classification/resnet_ctl_imagenet_test.py
...l/vision/image_classification/resnet_ctl_imagenet_test.py
+3
-0
official/vision/image_classification/resnet_imagenet_test.py
official/vision/image_classification/resnet_imagenet_test.py
+3
-0
No files found.
official/vision/image_classification/resnet_ctl_imagenet_test.py
View file @
b37c3fc1
...
...
@@ -53,10 +53,13 @@ class CtlImagenetTest(tf.test.TestCase):
def
setUp
(
self
):
super
(
CtlImagenetTest
,
self
).
setUp
()
imagenet_preprocessing
.
NUM_IMAGES
[
'validation'
]
=
4
self
.
policy
=
\
tf
.
compat
.
v2
.
keras
.
mixed_precision
.
experimental
.
global_policy
()
def
tearDown
(
self
):
super
(
CtlImagenetTest
,
self
).
tearDown
()
tf
.
io
.
gfile
.
rmtree
(
self
.
get_temp_dir
())
tf
.
compat
.
v2
.
keras
.
mixed_precision
.
experimental
.
set_policy
(
self
.
policy
)
def
test_end_to_end_no_dist_strat
(
self
):
"""Test Keras model with 1 GPU, no distribution strategy."""
...
...
official/vision/image_classification/resnet_imagenet_test.py
View file @
b37c3fc1
...
...
@@ -45,10 +45,13 @@ class KerasImagenetTest(tf.test.TestCase):
def
setUp
(
self
):
super
(
KerasImagenetTest
,
self
).
setUp
()
imagenet_preprocessing
.
NUM_IMAGES
[
"validation"
]
=
4
self
.
policy
=
\
tf
.
compat
.
v2
.
keras
.
mixed_precision
.
experimental
.
global_policy
()
def
tearDown
(
self
):
super
(
KerasImagenetTest
,
self
).
tearDown
()
tf
.
io
.
gfile
.
rmtree
(
self
.
get_temp_dir
())
tf
.
compat
.
v2
.
keras
.
mixed_precision
.
experimental
.
set_policy
(
self
.
policy
)
def
test_end_to_end_no_dist_strat
(
self
):
"""Test Keras model with 1 GPU, no distribution strategy."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment