import tensorflow as tf
import numpy as np

# restore variables
# redefine the same shape and same type for your variables
W = tf.Variable(np.arange(6).reshape(2, 3), dtype=tf.float32, name='Weights')#name must be the same with saver
b = tf.Variable(np.arange(3).reshape(1, 3), dtype=tf.float32, name='biases')

# not need init step

saver = tf.train.Saver()
with tf.Session() as sess:
    saver.restore(sess, "my_net/save_net.ckpt")
    print("weight:", sess.run(W))
    print("biases:", sess.run(b))

f0fdf95627426b1f15dba33cda0fd013937c2c96
<mask token>

<mask token>
with tf.Session() as sess:
    saver.restore(sess, 'my_net/save_net.ckpt')
    print('weight:', sess.run(W))
    print('biases:', sess.run(b))

<mask token>
W = tf.Variable(np.arange(6).reshape(2, 3), dtype=tf.float32, name='Weights')
b = tf.Variable(np.arange(3).reshape(1, 3), dtype=tf.float32, name='biases')
saver = tf.train.Saver()
with tf.Session() as sess:
    saver.restore(sess, 'my_net/save_net.ckpt')
    print('weight:', sess.run(W))
    print('biases:', sess.run(b))

import tensorflow as tf
import numpy as np
W = tf.Variable(np.arange(6).reshape(2, 3), dtype=tf.float32, name='Weights')
b = tf.Variable(np.arange(3).reshape(1, 3), dtype=tf.float32, name='biases')
saver = tf.train.Saver()
with tf.Session() as sess:
    saver.restore(sess, 'my_net/save_net.ckpt')
    print('weight:', sess.run(W))
    print('biases:', sess.run(b))

import tensorflow as tf
import numpy as np

# restore variables
# redefine the same shape and same type for your variables
W = tf.Variable(np.arange(6).reshape(2, 3), dtype=tf.float32, name='Weights')#name must be the same with saver
b = tf.Variable(np.arange(3).reshape(1, 3), dtype=tf.float32, name='biases')

# not need init step

saver = tf.train.Saver()
with tf.Session() as sess:
    saver.restore(sess, "my_net/save_net.ckpt")
    print("weight:", sess.run(W))
    print("biases:", sess.run(b))
