Skip to content

Commit

Permalink
Fixing the filename check for PNG files (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
niyazpk authored and nealwu committed Sep 26, 2017
1 parent 16e4679 commit 33ca217
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions research/inception/inception/data/build_image_data.py
Expand Up @@ -183,7 +183,7 @@ def _is_png(filename):
Returns:
boolean indicating if the image is a PNG.
"""
return '.png' in filename
return filename.endswith('.png')


def _process_image(filename, coder):
Expand Down Expand Up @@ -264,7 +264,7 @@ def _process_image_files_batch(coder, thread_index, ranges, name, filenames,
image_buffer, height, width = _process_image(filename, coder)
except Exception as e:
print(e)
print('SKIPPED: Unexpected eror while decoding %s.' % filename)
print('SKIPPED: Unexpected error while decoding %s.' % filename)
continue

example = _convert_to_example(filename, image_buffer, label,
Expand Down

0 comments on commit 33ca217

Please sign in to comment.