code: def get_data_sample(annotation_file, annotations_dir, data_dir):
      labels = []
      image_file = annotation_file.replace(
          annotations_dir, data_dir
      ).replace(".xml", ".JPEG")
      if tf.gfile.Exists(annotation_file) and tf.gfile.Exists(
          image_file
      ):
          xmltree = ElementTree.parse(annotation_file)
          objects = xmltree.findall("object")
          for object_iter in objects:
              labels.append(object_iter.find("name").text)
      else:
          image_file = None
      return image_file, labels
  
imports: import argparse
  import logging
  import multiprocessing
  import os
  import random
  import sys
  import time
  from xml.etree import ElementTree
  import numpy
  import tensorflow
  from tensorflow.contrib import slim
  from tensorflow.contrib.slim.python.slim.nets.inception_v3 import inception_v3, inception_v3_arg_scope
  from tensorflow.python.framework.errors_impl import OutOfRangeError
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training.basic_session_run_hooks import StopAtStepHook
  from tensorflow.python.training.monitored_session import SingularMonitoredSession
  import tensorlayer
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_sample(annotation_file, annotations_dir, data_dir) and returns: image_file,  labels