import tensorflow as tf

        f.write("final loss:" + str(format(loss_out)) +" \n")        
        f.write("final test accuracy:" + str(format(accuracy_out)) +" \n")
        f.write("best epoch's test accuracy:" + str(format(best_accuracy)) + " \n")
else :
    # Running a new session
    print("Starting 2nd session...")
    with tf.Session() as sess:
        # Initialize variables
        sess.run(init)
        f.write("---Restore model \n")

        # Restore model weights from previously saved model
