import tensorflow as tf

        else:
            saver.restore(sess, args.model_path)

        for i in range(max_train_step):
            batch_x, batch_gt = mnist.train.next_batch(batch_size)
            sess.run(train_op, feed_dict={x: batch_x, gt: batch_gt})

            if i % 100 == 0:
                correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(gt, 1))
                accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
                print('=> accuracy: {}'.format(sess.run(accuracy, feed_dict={x: mnist.test.images, gt: mnist.test.labels})))
                saver.save(sess, 'mnist/mnist_{:02d}.ckpt'.format(int(i / 100) + 1))
