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
6ab25864
Commit
6ab25864
authored
Jan 30, 2018
by
Yuxin Wu
Committed by
Karmel Allison
Jan 30, 2018
Browse files
Update build_imagenet_data.py (#3112)
parent
331e1372
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
research/inception/inception/data/build_imagenet_data.py
research/inception/inception/data/build_imagenet_data.py
+3
-1
No files found.
research/inception/inception/data/build_imagenet_data.py
View file @
6ab25864
...
@@ -170,6 +170,8 @@ def _float_feature(value):
...
@@ -170,6 +170,8 @@ def _float_feature(value):
def
_bytes_feature
(
value
):
def
_bytes_feature
(
value
):
"""Wrapper for inserting bytes features into Example proto."""
"""Wrapper for inserting bytes features into Example proto."""
if
isinstance
(
value
,
six
.
string_types
):
value
=
six
.
binary_type
(
value
,
encoding
=
'utf-8'
)
return
tf
.
train
.
Feature
(
bytes_list
=
tf
.
train
.
BytesList
(
value
=
[
value
]))
return
tf
.
train
.
Feature
(
bytes_list
=
tf
.
train
.
BytesList
(
value
=
[
value
]))
...
@@ -312,7 +314,7 @@ def _process_image(filename, coder):
...
@@ -312,7 +314,7 @@ def _process_image(filename, coder):
width: integer, image width in pixels.
width: integer, image width in pixels.
"""
"""
# Read the image file.
# Read the image file.
with
tf
.
gfile
.
FastGFile
(
filename
,
'r'
)
as
f
:
with
tf
.
gfile
.
FastGFile
(
filename
,
'r
b
'
)
as
f
:
image_data
=
f
.
read
()
image_data
=
f
.
read
()
# Clean the dirty data.
# Clean the dirty data.
...
...
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