Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix save large parameters failed #3397

Merged
merged 4 commits into from
Aug 11, 2017

Conversation

Yancey1989
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.

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

@Yancey1989 Yancey1989 merged commit 7e8c337 into PaddlePaddle:develop Aug 11, 2017
@Yancey1989 Yancey1989 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