未验证 提交 ff598665 编写于 作者: J Jiabin Yang 提交者: GitHub

test=develop, fix mnist will segment fault (#18083)

上级 d9270af9
...@@ -78,7 +78,10 @@ def reader_creator(image_filename, label_filename, buffer_size): ...@@ -78,7 +78,10 @@ def reader_creator(image_filename, label_filename, buffer_size):
buffer_size, rows * cols)).astype('float32') buffer_size, rows * cols)).astype('float32')
offset_img += struct.calcsize(fmt_images) offset_img += struct.calcsize(fmt_images)
images = images / 255.0 * 2.0 - 1.0 images = images / 255.0
images = images * 2.0
images = images - 1.0
for i in range(buffer_size): for i in range(buffer_size):
yield images[i, :], int(labels[i]) yield images[i, :], int(labels[i])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册