import tensorflow as tf import numpy as np W = tf.Variable([[2,1,8],[1,2,5]], dtype=tf.float32, name='weights') b = tf.Variable([[1,2,5]], dtype=tf.float32, name='biases') init= tf.global_variables_initializer() saver = tf.train.Saver() with tf.Session() as sess: sess.run(init) save_path = saver.save(sess, "niu/save_net.ckpt") print("Save to path: ", save_path)