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
ca6f9026
Commit
ca6f9026
authored
Jan 24, 2020
by
Pavithra Vijay
Committed by
A. Unique TensorFlower
Jan 24, 2020
Browse files
Internal change
PiperOrigin-RevId: 291432304
parent
ec553860
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
official/vision/image_classification/cifar_preprocessing.py
official/vision/image_classification/cifar_preprocessing.py
+0
-2
official/vision/image_classification/resnet_cifar_main.py
official/vision/image_classification/resnet_cifar_main.py
+4
-4
No files found.
official/vision/image_classification/cifar_preprocessing.py
View file @
ca6f9026
...
...
@@ -76,8 +76,6 @@ def parse_record(raw_record, is_training, dtype):
image
=
preprocess_image
(
image
,
is_training
)
image
=
tf
.
cast
(
image
,
dtype
)
# TODO(haoyuzhang,hongkuny,tobyboyd): Remove or replace the use of V1 API
label
=
tf
.
compat
.
v1
.
sparse_to_dense
(
label
,
(
NUM_CLASSES
,),
1
)
return
image
,
label
...
...
official/vision/image_classification/resnet_cifar_main.py
View file @
ca6f9026
...
...
@@ -161,17 +161,17 @@ def run(flags_obj):
# a valid arg for this model. Also remove as a valid flag.
if
flags_obj
.
force_v2_in_keras_compile
is
not
None
:
model
.
compile
(
loss
=
'categorical_crossentropy'
,
loss
=
'
sparse_
categorical_crossentropy'
,
optimizer
=
optimizer
,
metrics
=
([
'categorical_accuracy'
]
metrics
=
([
'
sparse_
categorical_accuracy'
]
if
flags_obj
.
report_accuracy_metrics
else
None
),
run_eagerly
=
flags_obj
.
run_eagerly
,
experimental_run_tf_function
=
flags_obj
.
force_v2_in_keras_compile
)
else
:
model
.
compile
(
loss
=
'categorical_crossentropy'
,
loss
=
'
sparse_
categorical_crossentropy'
,
optimizer
=
optimizer
,
metrics
=
([
'categorical_accuracy'
]
metrics
=
([
'
sparse_
categorical_accuracy'
]
if
flags_obj
.
report_accuracy_metrics
else
None
),
run_eagerly
=
flags_obj
.
run_eagerly
)
...
...
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