提交 fa7cb0bc 编写于 作者: W WuHaobo

be compatible with py3

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