From c486d842590eae2b5234eb9dc79c1c6e238aecc5 Mon Sep 17 00:00:00 2001 From: wenxuanxie Date: Sat, 27 May 2017 10:40:55 +0800 Subject: [PATCH] Update im2rec.py Updated Line 107 of 'im2rec.py'. Read an image as binary. --- tools/im2rec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/im2rec.py b/tools/im2rec.py index 17b8754b1f63..380ad1e43162 100644 --- a/tools/im2rec.py +++ b/tools/im2rec.py @@ -104,7 +104,7 @@ def image_encode(args, i, item, q_out): if args.pass_through: try: - with open(fullpath) as fin: + with open(fullpath, 'rb') as fin: img = fin.read() s = mx.recordio.pack(header, img) q_out.put((i, s, item))