Skip to content
Snippets Groups Projects
Commit 07716af6 authored by tomrink's avatar tomrink
Browse files

more work on saving/restoring ewa trainable variables...

parent ad23361d
No related branches found
No related tags found
No related merge requests found
......@@ -915,13 +915,17 @@ class IcingIntensityNN:
self.build_dnn(flat)
self.model = tf.keras.Model(self.inputs, self.logits)
def restore(self, ckpt_dir):
def restore(self, ckpt_dir, varsdir=None):
ckpt = tf.train.Checkpoint(step=tf.Variable(1), model=self.model)
ckpt_manager = tf.train.CheckpointManager(ckpt, ckpt_dir, max_to_keep=3)
ckpt.restore(ckpt_manager.latest_checkpoint)
if TRACK_MOVING_AVERAGE:
savr = tf.compat.v1.train.Saver(self.model.trainable_variables)
savr.restore(None, varsdir)
self.test_loss.reset_states()
self.test_accuracy.reset_states()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment