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
02cf1f87
Commit
02cf1f87
authored
Apr 14, 2020
by
Zongwei Zhou
Committed by
A. Unique TensorFlower
Apr 14, 2020
Browse files
Fix errors in classifier trainer when there is no distribution strategy
PiperOrigin-RevId: 306495321
parent
0bfdad07
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
official/vision/image_classification/classifier_trainer.py
official/vision/image_classification/classifier_trainer.py
+4
-2
No files found.
official/vision/image_classification/classifier_trainer.py
View file @
02cf1f87
...
@@ -109,7 +109,8 @@ def _get_dataset_builders(params: base_configs.ExperimentConfig,
...
@@ -109,7 +109,8 @@ def _get_dataset_builders(params: base_configs.ExperimentConfig,
logging
.
warning
(
'label_smoothing not applied, so datasets will not be one '
logging
.
warning
(
'label_smoothing not applied, so datasets will not be one '
'hot encoded.'
)
'hot encoded.'
)
num_devices
=
strategy
.
num_replicas_in_sync
num_devices
=
strategy
.
num_replicas_in_sync
if
strategy
else
1
image_size
=
get_image_size_from_model
(
params
)
image_size
=
get_image_size_from_model
(
params
)
dataset_configs
=
[
dataset_configs
=
[
...
@@ -309,7 +310,8 @@ def train_and_eval(
...
@@ -309,7 +310,8 @@ def train_and_eval(
strategy_scope
=
distribution_utils
.
get_strategy_scope
(
strategy
)
strategy_scope
=
distribution_utils
.
get_strategy_scope
(
strategy
)
logging
.
info
(
'Detected %d devices.'
,
strategy
.
num_replicas_in_sync
)
logging
.
info
(
'Detected %d devices.'
,
strategy
.
num_replicas_in_sync
if
strategy
else
1
)
label_smoothing
=
params
.
model
.
loss
.
label_smoothing
label_smoothing
=
params
.
model
.
loss
.
label_smoothing
one_hot
=
label_smoothing
and
label_smoothing
>
0
one_hot
=
label_smoothing
and
label_smoothing
>
0
...
...
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