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
4862ac84
Commit
4862ac84
authored
Jun 01, 2022
by
Fan Yang
Committed by
A. Unique TensorFlower
Jun 01, 2022
Browse files
Internal change
PiperOrigin-RevId: 452345162
parent
0aadb8d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
official/vision/dataloaders/tfexample_utils.py
official/vision/dataloaders/tfexample_utils.py
+3
-0
No files found.
official/vision/dataloaders/tfexample_utils.py
View file @
4862ac84
...
...
@@ -159,11 +159,14 @@ def create_distillation_example(
np
.
uint8
(
np
.
random
.
rand
(
image_height
,
image_width
,
3
)
*
255
),
fmt
=
image_format
)
soft_labels
=
[
0.6
]
*
num_labels
labels
=
[
0
]
serialized_example
=
tf
.
train
.
Example
(
features
=
tf
.
train
.
Features
(
feature
=
{
IMAGE_KEY
:
(
tf
.
train
.
Feature
(
bytes_list
=
tf
.
train
.
BytesList
(
value
=
[
image
]))),
CLASSIFICATION_LABEL_KEY
:
(
tf
.
train
.
Feature
(
int64_list
=
tf
.
train
.
Int64List
(
value
=
labels
))),
DISTILATION_LABEL_KEY
:
(
tf
.
train
.
Feature
(
float_list
=
tf
.
train
.
FloatList
(
value
=
soft_labels
))),
})).
SerializeToString
()
...
...
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