Skip to content

Instantly share code, notes, and snippets.

@FrancescoSaverioZuppichini
Last active July 4, 2018 14:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save FrancescoSaverioZuppichini/7e22a21a3fedbeaf8a2cac3b1ea98e7e to your computer and use it in GitHub Desktop.
with tf.Session() as sess:
mnist_model(x, y) # build the model
sess.run(tf.global_variables_initializer())
sess.run(train_init_op, feed_dict={x_: train[0], y_: train[1]})
saver = tf.train.Saver()
for i in range(150):
acc, _ = sess.run([mnist_model.accuracy, mnist_model.train_step])
if i % 15 == 0:
print(acc)
saver.save(sess,'/tmp/model.ckpt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment