diff --git a/python/paddle_serving_app/reader/image_reader.py b/python/paddle_serving_app/reader/image_reader.py index 7988bf447b5a0a075171d93d22dd1933aa8532b8..7f4a795513447d74e7f02d7741344ccae81c7c9d 100644 --- a/python/paddle_serving_app/reader/image_reader.py +++ b/python/paddle_serving_app/reader/image_reader.py @@ -296,7 +296,10 @@ class File2Image(object): pass def __call__(self, img_path): - fin = open(img_path) + if py_version == 2: + fin = open(img_path) + else: + fin = open(img_path, "rb") sample = fin.read() data = np.fromstring(sample, np.uint8) img = cv2.imdecode(data, cv2.IMREAD_COLOR)