提交 fa7cb0bc 编写于 作者: W WuHaobo

be compatible with py3

上级 fe7274bc
......@@ -189,9 +189,9 @@ def partial_reader(params, full_lines, part_id=0, part_num=1):
for line in full_lines:
img_path, label = line.split()
img_path = os.path.join(params['data_dir'], img_path)
img = open(img_path).read()
img = transform(img, ops)
yield (img, int(label))
with open(img_path, 'rb') as f:
img = f.read()
yield (transform(img, ops), int(label))
return reader
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册