-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Python API for save/load variables #5136
Conversation
b47fba0
to
1f6a0e9
Compare
@@ -0,0 +1,143 @@ | |||
import os |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.