Skip to content

Conversation

Yancey0623
Copy link
Contributor

Fixed #2895

if not buf:
break
f.write(buf)
wrote_size += 65535
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s = param.tostring()
wrote_size = 0
buf = buffer(s, wrote_size, 65535)
while buf: # f.write crashes with big data blog.
  f.write(buf)
  wrote_size += 65535

这样可以吗?是不是可以代码简练点儿?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多谢👍,的确可以更简练。

@Yancey0623 Yancey0623 merged commit 7e8c337 into PaddlePaddle:develop Aug 11, 2017
@Yancey0623 Yancey0623 deleted the fix_save_parametres branch August 11, 2017 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants