File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
research/compression/image_encoder Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def main(_):
71
71
return
72
72
73
73
contents = ''
74
- with tf .gfile .FastGFile (FLAGS .input_codes , 'r ' ) as code_file :
74
+ with tf .gfile .FastGFile (FLAGS .input_codes , 'rb ' ) as code_file :
75
75
contents = code_file .read ()
76
76
loaded_codes = np .load (io .BytesIO (contents ))
77
77
assert ['codes' , 'shape' ] not in loaded_codes .files
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ def main(_):
59
59
print ('\n --iteration must be between 0 and 15 inclusive.\n ' )
60
60
return
61
61
62
- with tf .gfile .FastGFile (FLAGS .input_image ) as input_image :
62
+ with tf .gfile .FastGFile (FLAGS .input_image , 'rb' ) as input_image :
63
63
input_image_str = input_image .read ()
64
64
65
65
with tf .Graph ().as_default () as graph :
Original file line number Diff line number Diff line change @@ -199,9 +199,9 @@ def main(_):
199
199
return
200
200
201
201
with tf .gfile .FastGFile (FLAGS .original_image ) as image_file :
202
- img1_str = image_file .read ()
202
+ img1_str = image_file .read ('rb' )
203
203
with tf .gfile .FastGFile (FLAGS .compared_image ) as image_file :
204
- img2_str = image_file .read ()
204
+ img2_str = image_file .read ('rb' )
205
205
206
206
input_img = tf .placeholder (tf .string )
207
207
decoded_image = tf .expand_dims (tf .image .decode_png (input_img , channels = 3 ), 0 )
You can’t perform that action at this time.
0 commit comments