Skip to content

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

Merged
merged 3 commits into from
May 4, 2018
Merged

Trainer save load params #10386

merged 3 commits into from
May 4, 2018

Conversation

jetfuel
Copy link
Contributor

@jetfuel jetfuel commented May 3, 2018

Fixs #10310

@@ -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)
Copy link
Contributor

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 (

executor.run(save_program)
)

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed offline.

Copy link
Contributor

@helinwang helinwang left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@jetfuel jetfuel merged commit bd66eed into develop May 4, 2018
@jetfuel jetfuel deleted the trainerSaveLoadParams branch May 4, 2018 18:30
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