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

Python API for save/load variables #5136

Merged

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Oct 26, 2017

No description provided.

@reyoung reyoung requested a review from JiayiFeng October 26, 2017 21:03
@reyoung reyoung force-pushed the feature/save_load_op_in_python branch from b47fba0 to 1f6a0e9 Compare October 26, 2017 21:03
@@ -0,0 +1,143 @@
import os
Copy link
Collaborator

Choose a reason for hiding this comment

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

save_load => model or io ?

@@ -486,6 +486,11 @@ def sync_with_cpp(self):
for block in self.blocks:
block.sync_with_cpp()

def iter_all_vars(self):
Copy link
Collaborator

@wangkuiyi wangkuiyi Oct 26, 2017

Choose a reason for hiding this comment

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

iter_all_vars => list_vars ?

@@ -4,6 +4,7 @@
import paddle.v2.framework.optimizer as optimizer

from paddle.v2.framework.framework import Program, g_program
from paddle.v2.framework.save_load import save_persistables, load_persistables
Copy link
Collaborator

@wangkuiyi wangkuiyi Oct 26, 2017

Choose a reason for hiding this comment

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

It seems from this example that what users need is save/load_persistables. Then, do we really need save/load_params?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, save/load_params used for inference.

wangkuiyi
wangkuiyi previously approved these changes Oct 26, 2017
JiayiFeng
JiayiFeng previously approved these changes Oct 26, 2017
Copy link
Collaborator

@JiayiFeng JiayiFeng left a comment

Choose a reason for hiding this comment

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

LGTM!

@reyoung reyoung dismissed stale reviews from JiayiFeng and wangkuiyi via 0cf72c1 October 26, 2017 22:26
@JiayiFeng JiayiFeng merged commit 2366284 into PaddlePaddle:develop Oct 26, 2017
@reyoung reyoung deleted the feature/save_load_op_in_python branch October 28, 2017 22:12
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.

3 participants