From c79ae754c49c30e73ec3ac8fcc598a1f53e5b03e Mon Sep 17 00:00:00 2001 From: WuHaobo Date: Sun, 26 Apr 2020 15:57:02 +0800 Subject: [PATCH] be compatible with Python3 --- tools/infer/infer.py | 2 +- tools/infer/py_infer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/infer/infer.py b/tools/infer/infer.py index b06a51bd..0962bcca 100644 --- a/tools/infer/infer.py +++ b/tools/infer/infer.py @@ -85,7 +85,7 @@ def create_operators(): def preprocess(fname, ops): - data = open(fname).read() + data = open(fname, 'rb').read() for op in ops: data = op(data) diff --git a/tools/infer/py_infer.py b/tools/infer/py_infer.py index 8236bc6f..512c16b3 100644 --- a/tools/infer/py_infer.py +++ b/tools/infer/py_infer.py @@ -67,7 +67,7 @@ def create_operators(): def preprocess(fname, ops): - data = open(fname).read() + data = open(fname, 'rb').read() for op in ops: data = op(data) -- GitLab