-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Trainer save load params #10386
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
Trainer save load params #10386
Conversation
python/paddle/fluid/trainer.py
Outdated
@@ -124,7 +124,10 @@ def test(self, reader): | |||
|
|||
def save_params(self, param_path): | |||
# reference: save_persistables in io.py | |||
pass | |||
exe = executor.Executor(self.place) | |||
exe.run(self.startup_program, scope=self.scope) |
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.
I am not sure if we need this. I guess save_persistables
will call save_vars
which will run the executor (
Paddle/python/paddle/fluid/io.py
Line 129 in 0ecc6fa
executor.run(save_program) |
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.
Ah I see. So
save_program = Program()
save_block = save_program.global_block()
already loads all the variables from the scope?
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.
Discussed offline.
…ram to the 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.
LGTM, thank you!
Fixs #10310