code: def main(_):
      # Import data
      mnist = input_data.read_data_sets(FLAGS.data_dir)
  
      # Create the model
      x = tf.placeholder(tf.float32, [None, 784])
  
      # Define loss and optimizer
      y_ = tf.placeholder(tf.int64, [None])
  
      # Build the graph for the deep net
      y_conv = deepnn(x)
  
      with tf.name_scope("loss"):
          cross_entropy = tf.losses.sparse_softmax_cross_entropy(
              labels=y_, logits=y_conv
          )
          cross_entropy = tf.reduce_mean(cross_entropy)
  
      with tf.name_scope("adam_optimizer"):
          train_step = tf.train.AdamOptimizer(1e-2).minimize(
              cross_entropy
          )
  
      with tf.name_scope("accuracy"):
          correct_prediction = tf.equal(tf.argmax(y_conv, 1), y_)
          correct_prediction = tf.cast(correct_prediction, tf.float32)
          accuracy = tf.reduce_mean(correct_prediction)
  
      with tf.Session() as sess:
          sess.run(tf.global_variables_initializer())
          for i in range(2000):
              batch = mnist.train.next_batch(50)
              if i % 100 == 0:
                  train_accuracy = accuracy.eval(
                      feed_dict={x: batch[0], y_: batch[1]}
                  )
                  print(
                      "step %d, training accuracy %g"
                      % (i, train_accuracy)
                  )
              train_step.run(feed_dict={x: batch[0], y_: batch[1]})
  
          # compute in batches to avoid OOM on GPUs
          accuracy_l = []
          for _ in range(20):
              batch = mnist.test.next_batch(500, shuffle=False)
  
              accuracy_l.append(
                  accuracy.eval(feed_dict={x: batch[0], y_: batch[1]})
              )
  
          print("test accuracy %g" % numpy.mean(accuracy_l))
  
          # Export model to protobuf file
          current_dir = os.getcwd()
          pb_filename = "/test_data/mnist_model.pb"
          export_to_pb(sess, y_conv, current_dir + pb_filename)
  
          # Export sample mnist data
          np_filename = "/test_data/mnist_input.npy"
          numpy.save(current_dir + np_filename, mnist.test.images[0])
  
file_path: tf-encrypted/examples/deprecated/mnist_deep_cnn.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import os
  import sys
  import numpy
  import tensorflow
  from tensorflow.examples.tutorials.mnist import input_data
  from tensorflow.python.framework import graph_io
  from tensorflow.python.framework import graph_util
label_desc: Use image node_id 6 for calling a global function with example usage: main(_) without return types