<jupyter_start><jupyter_text>Save<jupyter_code>weights = tf.Variable(tf.truncated_normal([2, 3]))
bias = tf.Variable(tf.truncated_normal([3]))
saver = tf.train.Saver()
with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    print('Weights:')
    print(sess.run(weights))
    print('Bias:')
    print(sess.run(bias))
    
    saver.save(sess,save_file)<jupyter_output>Weights:
[[-1.089087   -0.5332822  -0.21399547]
 [-1.066126   -0.26974714  0.5607334 ]]
Bias:
[-1.182716    0.62959874 -1.0225731 ]<jupyter_text>Restore<jupyter_code>tf.reset_default_graph()
weights = tf.Variable(tf.truncated_normal([2, 3]))
bias = tf.Variable(tf.truncated_normal([3]))
saver = tf.train.Saver()
with tf.Session() as sess:
    saver.restore(sess, save_file)

    print('Weight:')
    print(sess.run(weights))
    print('Bias:')
    print(sess.run(bias))<jupyter_output>INFO:tensorflow:Restoring parameters from ./savedInstance.ckpt
Weight:
[[-1.089087   -0.5332822  -0.21399547]
 [-1.066126   -0.26974714  0.5607334 ]]
Bias:
[-1.182716    0.62959874 -1.0225731 ]
{'fraction_non_alphanumeric': 0.17228464419475656, 'fraction_numerical': 0.1404494382022472, 'mean_word_length': 4.454081632653061, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '604082', 'license': 'MIT', 'n_tokens_mistral': 535, 'n_tokens_neox': 454, 'n_words': 59, 'path': 'Deep Learning/Neural Networks/TensorFlow/saveRestore.ipynb', 'repo_name': 'bhupendpatil/Practice', 'size': '1068'}