Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion research/compression/image_encoder/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main(_):
return

contents = ''
with tf.gfile.FastGFile(FLAGS.input_codes, 'r') as code_file:
with tf.gfile.FastGFile(FLAGS.input_codes, 'rb') as code_file:
contents = code_file.read()
loaded_codes = np.load(io.BytesIO(contents))
assert ['codes', 'shape'] not in loaded_codes.files
Expand Down
2 changes: 1 addition & 1 deletion research/compression/image_encoder/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main(_):
print('\n--iteration must be between 0 and 15 inclusive.\n')
return

with tf.gfile.FastGFile(FLAGS.input_image) as input_image:
with tf.gfile.FastGFile(FLAGS.input_image, 'rb') as input_image:
input_image_str = input_image.read()

with tf.Graph().as_default() as graph:
Expand Down
4 changes: 2 additions & 2 deletions research/compression/image_encoder/msssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def main(_):
return

with tf.gfile.FastGFile(FLAGS.original_image) as image_file:
img1_str = image_file.read()
img1_str = image_file.read('rb')
with tf.gfile.FastGFile(FLAGS.compared_image) as image_file:
img2_str = image_file.read()
img2_str = image_file.read('rb')

input_img = tf.placeholder(tf.string)
decoded_image = tf.expand_dims(tf.image.decode_png(input_img, channels=3), 0)
Expand Down