Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1751406

Browse files
authored
Merge pull request tensorflow#834 from BoyuanJiang/patch-2
Update build_image_data.py
2 parents bfa1bb1 + 9997b25 commit 1751406

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

inception/inception/data/build_image_data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ def _convert_to_example(filename, image_buffer, label, text, height, width):
137137
example = tf.train.Example(features=tf.train.Features(feature={
138138
'image/height': _int64_feature(height),
139139
'image/width': _int64_feature(width),
140-
'image/colorspace': _bytes_feature(colorspace),
140+
'image/colorspace': _bytes_feature(tf.compat.as_bytes(colorspace)),
141141
'image/channels': _int64_feature(channels),
142142
'image/class/label': _int64_feature(label),
143-
'image/class/text': _bytes_feature(text),
144-
'image/format': _bytes_feature(image_format),
145-
'image/filename': _bytes_feature(os.path.basename(filename)),
146-
'image/encoded': _bytes_feature(image_buffer)}))
143+
'image/class/text': _bytes_feature(tf.compat.as_bytes(text)),
144+
'image/format': _bytes_feature(tf.compat.as_bytes(image_format)),
145+
'image/filename': _bytes_feature(tf.compat.as_bytes(os.path.basename(filename))),
146+
'image/encoded': _bytes_feature(tf.compat.as_bytes(image_buffer))}))
147147
return example
148148

149149

0 commit comments

Comments
 (0)