Closed Spiess closed 5 years ago
What if you try to cast each variable to a Saveable
? For example: vars.map(_: Saveable)
, where vars
is a set of variables. Does an implicit conversion happen if you do that?
Unfortunately vars.map(_: Saveable)
doesn't work. I've also tried variables.map(variable => variable.castTo[Saveable])
(no implicits found for parameter evidence), val variables: Set[Saveable] = Set(variable)
and casting each variable individually.
I see. So it is an implicit class but it was private. I removed the private modifier on master. Sorry about that! :)
To specify the variables to be saved for
tf.saver
they must be wrapped asSaveable
objects. By default,tf.saver()
wraps all global variables in the graph asVariableSaveable
(a class unfortunately private to theops
package), however I have been unable to find a way to convert a specific set of variables to saveables to be able to selectively load variable values from different checkpoints.