In [1]:
import tensorflow as tf
import numpy as np
In [2]:
# This works only once - to re-run, restart the Kernel first.
load_from = r'C:\Temp\tf_demo\ols.ckpt'
w = tf.Variable(np.ones([3, 1]), name='w')
with tf.Session() as sess:
saver = tf.train.Saver()
saver.restore(sess, load_from)
w_current = w.eval(session=sess)
In [5]:
w_current = np.squeeze(w_current)
In [6]:
w_current
Out[6]: