"tests/git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "a1612d79318f10eaab3c785b9cb94ee841e72440"
Commit 4862ac84 authored by Fan Yang's avatar Fan Yang Committed by A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 452345162
parent 0aadb8d3
...@@ -159,11 +159,14 @@ def create_distillation_example( ...@@ -159,11 +159,14 @@ def create_distillation_example(
np.uint8(np.random.rand(image_height, image_width, 3) * 255), np.uint8(np.random.rand(image_height, image_width, 3) * 255),
fmt=image_format) fmt=image_format)
soft_labels = [0.6] * num_labels soft_labels = [0.6] * num_labels
labels = [0]
serialized_example = tf.train.Example( serialized_example = tf.train.Example(
features=tf.train.Features( features=tf.train.Features(
feature={ feature={
IMAGE_KEY: (tf.train.Feature( IMAGE_KEY: (tf.train.Feature(
bytes_list=tf.train.BytesList(value=[image]))), 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( DISTILATION_LABEL_KEY: (tf.train.Feature(
float_list=tf.train.FloatList(value=soft_labels))), float_list=tf.train.FloatList(value=soft_labels))),
})).SerializeToString() })).SerializeToString()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment