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
242229af
Commit
242229af
authored
Apr 10, 2020
by
Allen Wang
Committed by
A. Unique TensorFlower
Apr 10, 2020
Browse files
Internal changes
PiperOrigin-RevId: 305956008
parent
22de957a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
official/vision/image_classification/classifier_trainer_test.py
...al/vision/image_classification/classifier_trainer_test.py
+12
-25
No files found.
official/vision/image_classification/classifier_trainer_test.py
View file @
242229af
...
...
@@ -148,7 +148,7 @@ class ClassifierTest(tf.test.TestCase, parameterized.TestCase):
tf
.
io
.
gfile
.
rmtree
(
self
.
get_temp_dir
())
@
combinations
.
generate
(
distribution_strategy_combinations
())
def
test_end_to_end_train_and_eval
_export
(
self
,
distribution
,
model
,
dataset
):
def
test_end_to_end_train_and_eval
(
self
,
distribution
,
model
,
dataset
):
"""Test train_and_eval and export for Keras classifier models."""
# Some parameters are not defined as flags (e.g. cannot run
# classifier_train.py --batch_size=...) by design, so use
...
...
@@ -164,38 +164,25 @@ class ClassifierTest(tf.test.TestCase, parameterized.TestCase):
'--mode=train_and_eval'
,
]
export_params
=
basic_params_override
()
export_path
=
os
.
path
.
join
(
model_dir
,
'export'
)
export_params
[
'export'
]
=
{}
export_params
[
'export'
][
'destination'
]
=
export_path
export_flags
=
base_flags
+
[
'--mode=export_only'
,
get_params_override
(
export_params
)
]
run
=
functools
.
partial
(
classifier_trainer
.
run
,
strategy_override
=
distribution
)
run_end_to_end
(
main
=
run
,
extra_flags
=
train_and_eval_flags
,
model_dir
=
model_dir
)
run_end_to_end
(
main
=
run
,
extra_flags
=
export_flags
,
model_dir
=
model_dir
)
self
.
assertTrue
(
os
.
path
.
exists
(
export_path
))
@
combinations
.
generate
(
combinations
.
combine
(
distribution
=
[
strategy_combinations
.
one_device_strategy_gpu
,
],
model
=
[
'efficientnet'
,
'resnet'
,
],
mode
=
'eager'
,
dataset
=
'imagenet'
,
dtype
=
'float16'
,
))
distribution
=
[
strategy_combinations
.
one_device_strategy_gpu
,
],
model
=
[
'efficientnet'
,
'resnet'
,
],
mode
=
'eager'
,
dataset
=
'imagenet'
,
dtype
=
'float16'
,
))
def
test_gpu_train
(
self
,
distribution
,
model
,
dataset
,
dtype
):
"""Test train_and_eval and export for Keras classifier models."""
# Some parameters are not defined as flags (e.g. cannot run
...
...
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