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
ce1628a5
Commit
ce1628a5
authored
Mar 18, 2017
by
jtran064
Committed by
Neal Wu
Mar 20, 2017
Browse files
move exception message to caller loop and skip currupted files
parent
bde7ddfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
inception/inception/data/build_image_data.py
inception/inception/data/build_image_data.py
+8
-6
No files found.
inception/inception/data/build_image_data.py
View file @
ce1628a5
...
...
@@ -208,11 +208,7 @@ def _process_image(filename, coder):
image_data
=
coder
.
png_to_jpeg
(
image_data
)
# Decode the RGB JPEG.
try
:
image
=
coder
.
decode_jpeg
(
image_data
)
except
:
print
(
'Unexpected eror while decoding %s'
%
filename
)
raise
image
=
coder
.
decode_jpeg
(
image_data
)
# Check that image converted to RGB
assert
len
(
image
.
shape
)
==
3
...
...
@@ -265,7 +261,13 @@ def _process_image_files_batch(coder, thread_index, ranges, name, filenames,
label
=
labels
[
i
]
text
=
texts
[
i
]
image_buffer
,
height
,
width
=
_process_image
(
filename
,
coder
)
try
:
image_buffer
,
height
,
width
=
_process_image
(
filename
,
coder
)
except
Exception
,
e
:
print
(
e
)
print
(
'SKIPPED. Unexpected eror while decoding %s'
%
filename
)
continue
example
=
_convert_to_example
(
filename
,
image_buffer
,
label
,
text
,
height
,
width
)
...
...
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