Skip to content

Commit

Permalink
Fixed as per issue tensorflow#3252
Browse files Browse the repository at this point in the history
  • Loading branch information
gedefet committed Nov 14, 2018
1 parent 688242d commit ff420f9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions research/object_detection/metrics/tf_example_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ def __init__(self, field_name):
self.field_name = field_name

def parse(self, tf_example):
return "".join(tf_example.features.feature[self.field_name]
.bytes_list.value) if tf_example.features.feature[
self.field_name].HasField("bytes_list") else None
"""Fixed as per issue #3252"""
if tf_example.features.feature[self.field_name].HasField("bytes_list"):
result = tf_example.features.feature[self.field_name].bytes_list.value
result = "".join([x if type(x)=='str' else x.decode('utf-8', 'ignore') for x in result])
else:
result = None
return result


class Int64Parser(data_parser.DataToNumpyParser):
Expand Down

0 comments on commit ff420f9

Please sign in to comment.