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
f16b5784
Commit
f16b5784
authored
Aug 08, 2021
by
Yeqing Li
Committed by
A. Unique TensorFlower
Aug 08, 2021
Browse files
Adds gc to reduce flakiness of base_trainer_test.
PiperOrigin-RevId: 389526906
parent
d4c5f897
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
official/core/base_trainer_test.py
official/core/base_trainer_test.py
+8
-0
No files found.
official/core/base_trainer_test.py
View file @
f16b5784
...
...
@@ -14,6 +14,7 @@
"""Tests for tensorflow_models.core.trainers.trainer."""
# pylint: disable=g-direct-tensorflow-import
import
gc
import
multiprocessing
import
os
import
sys
...
...
@@ -164,6 +165,13 @@ class TrainerTest(tf.test.TestCase, parameterized.TestCase):
}
})))
def
tearDown
(
self
):
gc
.
collect
()
# This will only contain uncollectable garbage, i.e. reference cycles
# involving objects with __del__ defined.
self
.
assertEmpty
(
gc
.
garbage
)
super
().
tearDown
()
def
create_test_trainer
(
self
,
config
,
model_dir
=
None
,
task
=
None
):
task
=
task
or
mock_task
.
MockTask
(
config
.
task
,
logging_dir
=
model_dir
)
ckpt_exporter
=
train_lib
.
maybe_create_best_ckpt_exporter
(
config
,
model_dir
)
...
...
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