Skip to content

Adds Session.restore to allow loading of checkpoints saved by Session.save #225

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 5 commits into from
Feb 24, 2021

Conversation

Craigacp
Copy link
Collaborator

This allows the easy restoration of checkpoints during training. A fresh graph object loaded from a GraphDef will not have a SaverDef defined, so the method that creates a SaverDef was modified to check if the graph already had restore operations, in which case the names of the operations are filled in rather than trying to mutate the graph twice (which will throw an exception). The names are set based on the defaults used in Saver.py, though it's not identical as that adds an extra placeholder called "save/Const" for unspecified backwards compatibility, and when I mirror that in Java calling session.run gives TFIllegalArgumentException complaining that placeholder is unfilled.

It's not quite the same as the TF 2 checkpoint restore mechanism, but that seems tightly woven into the Python structure and we don't quite have the infrastructure yet.

I also bumped the version of maven-surefire-plugin as otherwise I get error messages out of Maven when running the tests. Not sure when this started, but it's happening for me on Ubuntu 20.04 x86_64.

Copy link
Collaborator

@karllessard karllessard left a comment

Choose a reason for hiding this comment

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

Thanks @Craigacp !

@karllessard karllessard merged commit cdd0298 into tensorflow:master Feb 24, 2021
@Craigacp Craigacp deleted the session-restore branch September 16, 2022 15:17
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