code: def main(_):
      batch_shape = [
          FLAGS.batch_size,
          FLAGS.image_height,
          FLAGS.image_width,
          3,
      ]
      nb_classes = 1001
  
      tf.logging.set_verbosity(tf.logging.INFO)
  
      with tf.Graph().as_default():
          # Prepare graph
          x_input = tf.placeholder(tf.float32, shape=batch_shape)
  
          with slim.arg_scope(inception.inception_v3_arg_scope()):
              _, end_points = inception.inception_v3(
                  x_input, num_classes=nb_classes, is_training=False
              )
  
          predicted_labels = tf.argmax(end_points["Predictions"], 1)
  
          # Run computation
          saver = tf.train.Saver(slim.get_model_variables())
          session_creator = tf.train.ChiefSessionCreator(
              scaffold=tf.train.Scaffold(saver=saver),
              checkpoint_filename_with_path=FLAGS.checkpoint_path,
              master=FLAGS.master,
          )
  
          with tf.train.MonitoredSession(
              session_creator=session_creator
          ) as sess:
              with tf.gfile.Open(FLAGS.output_file, "w") as out_file:
                  for filenames, images in load_images(
                      FLAGS.input_dir, batch_shape
                  ):
                      labels = sess.run(
                          predicted_labels, feed_dict={x_input: images}
                      )
                      for filename, label in zip(filenames, labels):
                          out_file.write(
                              "{0},{1}\n".format(filename, label)
                          )
  
file_path: cleverhans/cleverhans_v3.1.0/examples/nips17_adversarial_competition/dev_toolkit/sample_defenses/base_inception_model/defense.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  from scipy.misc import imread
  import tensorflow
  from tensorflow.contrib.slim.nets import inception
label_desc: Use image node_id 2 for calling a global function with example usage: main(_) without return types