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))