Commit 39704281 authored by Erekle's avatar Erekle Committed by aquariusjay
Browse files

Fixed UnicodeDecodeError error (#7006)

parent ce03903f
...@@ -91,11 +91,11 @@ def _convert_dataset(dataset_split, dataset_dir, dataset_label_dir): ...@@ -91,11 +91,11 @@ def _convert_dataset(dataset_split, dataset_dir, dataset_label_dir):
sys.stdout.flush() sys.stdout.flush()
# Read the image. # Read the image.
image_filename = img_names[i] image_filename = img_names[i]
image_data = tf.gfile.FastGFile(image_filename, 'r').read() image_data = tf.gfile.FastGFile(image_filename, 'rb').read()
height, width = image_reader.read_image_dims(image_data) height, width = image_reader.read_image_dims(image_data)
# Read the semantic segmentation annotation. # Read the semantic segmentation annotation.
seg_filename = seg_names[i] seg_filename = seg_names[i]
seg_data = tf.gfile.FastGFile(seg_filename, 'r').read() seg_data = tf.gfile.FastGFile(seg_filename, 'rb').read()
seg_height, seg_width = label_reader.read_image_dims(seg_data) seg_height, seg_width = label_reader.read_image_dims(seg_data)
if height != seg_height or width != seg_width: if height != seg_height or width != seg_width:
raise RuntimeError('Shape mismatched between image and label.') raise RuntimeError('Shape mismatched between image and label.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment