# Path: deployment/model_deploy.py
# def get_available_gpus():
#   def __init__(self, var_device, clone_device):
#   def choose(self, op):
# def create_clones(config, model_fn, args=None, kwargs=None, gpu_offset=0):
# def create_extra_clones_on_another_gpu(config, model_fn, args=None, kwargs=None):
# def _gather_clone_loss(clone, num_clones, regularization_losses):
# def _optimize_clone(optimizer, clone, num_clones, regularization_losses,
#                     **kwargs):
# def optimize_clones(clones, optimizer,
#                     regularization_losses=None,
#                     **kwargs):
# def deploy(config,
#            model_fn,
#            args=None,
#            kwargs=None,
#            optimizer=None,
#            summarize_gradients=False):
# def _sum_clones_gradients(clone_grads):
# def _add_gradients_summaries(grads_and_vars):
#   def __init__(self,
#                num_clones=1,
#                clone_on_cpu=False,
#                replica_id=0,
#                num_replicas=1,
#                num_ps_tasks=0,
#                worker_job_name='worker',
#                ps_job_name='ps'):
#   def num_clones(self):
#   def clone_on_cpu(self):
#   def replica_id(self):
#   def num_replicas(self):
#   def num_ps_tasks(self):
#   def ps_device(self):
#   def worker_device(self):
#   def caching_device(self):
#   def clone_device(self, clone_index, force=False):
#   def clone_scope(self, clone_index):
#   def optimizer_device(self):
#   def inputs_device(self):
#   def variables_device(self):
#       def __init__(self, device, tasks):
#       def choose(self, op):
# class VariableDeviceChooser(object):
# class DeploymentConfig(object):
#     class _PSDeviceChooser(object):
# 
# Path: deployment/train_util.py
# FLAGS = tf.app.flags.FLAGS
# def _configure_learning_rate(global_step):
# def _configure_optimizer(learning_rate):
# def _add_variables_summaries(learning_rate):
# def _load_weights():
# def _get_init_fn(variables_to_restore):
#         def init_with_weight(sess):
# def _get_variables_to_restore():
# def _get_variables_to_train():
# 
# Path: nets/nets_factory.py
# def get_network_fn(name, num_classes, weight_decay=0.0, is_training=False):
#   def network_fn(images):
#     def rnn_part(images):
# 
# Path: preprocessing/preprocessing_factory.py
# def get_preprocessing(name, is_training=False):
#   def preprocessing_fn(image, output_height, output_width, **kwargs):


import tensorflow as tf
import numpy as np
import time
import os
import math
import async_loader
from datetime import datetime
from tensorflow.python.ops import control_flow_ops
from deployment import model_deploy
from deployment import train_util
from nets import nets_factory
from preprocessing import preprocessing_factory
            'sec/batch)')
    print (format_str % (datetime.now(), num_eval_batches, msg,
                    test_examples_per_sec, test_duration))
    summary_str = sess.run(summary_op)
    summary_writer.add_summary(summary_str, num_eval_batches+1)
    summary_writer.flush()


def test():
    # Check training directory.
    train_dir = FLAGS.train_dir
    if not tf.gfile.IsDirectory(train_dir):
        tf.logging.info("Training directory %s not found.", train_dir)
        return

    # Build the TensorFlow graph.
    g = tf.Graph()
    with g.as_default():
        ####################
        # Select the network #
        ####################
        network_fn = nets_factory.get_network_fn(
                    FLAGS.model_name,
                    num_classes=FLAGS.NUM_CLASSES,
                    is_training=False)

        #####################################
        # Select the preprocessing function #
        #####################################
        preprocessing_name = FLAGS.preprocessing_name or FLAGS.model_name

# Path: deployment/model_deploy.py
# def get_available_gpus():
#   def __init__(self, var_device, clone_device):
#   def choose(self, op):
# def create_clones(config, model_fn, args=None, kwargs=None, gpu_offset=0):
# def create_extra_clones_on_another_gpu(config, model_fn, args=None, kwargs=None):
# def _gather_clone_loss(clone, num_clones, regularization_losses):
# def _optimize_clone(optimizer, clone, num_clones, regularization_losses,
#                     **kwargs):
# def optimize_clones(clones, optimizer,
#                     regularization_losses=None,
#                     **kwargs):
# def deploy(config,
#            model_fn,
#            args=None,
#            kwargs=None,
#            optimizer=None,
#            summarize_gradients=False):
# def _sum_clones_gradients(clone_grads):
# def _add_gradients_summaries(grads_and_vars):
#   def __init__(self,
#                num_clones=1,
#                clone_on_cpu=False,
#                replica_id=0,
#                num_replicas=1,
#                num_ps_tasks=0,
#                worker_job_name='worker',
#                ps_job_name='ps'):
#   def num_clones(self):
#   def clone_on_cpu(self):
#   def replica_id(self):
#   def num_replicas(self):
#   def num_ps_tasks(self):
#   def ps_device(self):
#   def worker_device(self):
#   def caching_device(self):
#   def clone_device(self, clone_index, force=False):
#   def clone_scope(self, clone_index):
#   def optimizer_device(self):
#   def inputs_device(self):
#   def variables_device(self):
#       def __init__(self, device, tasks):
#       def choose(self, op):
# class VariableDeviceChooser(object):
# class DeploymentConfig(object):
#     class _PSDeviceChooser(object):
# 
# Path: deployment/train_util.py
# FLAGS = tf.app.flags.FLAGS
# def _configure_learning_rate(global_step):
# def _configure_optimizer(learning_rate):
# def _add_variables_summaries(learning_rate):
# def _load_weights():
# def _get_init_fn(variables_to_restore):
#         def init_with_weight(sess):
# def _get_variables_to_restore():
# def _get_variables_to_train():
# 
# Path: nets/nets_factory.py
# def get_network_fn(name, num_classes, weight_decay=0.0, is_training=False):
#   def network_fn(images):
#     def rnn_part(images):
# 
# Path: preprocessing/preprocessing_factory.py
# def get_preprocessing(name, is_training=False):
#   def preprocessing_fn(image, output_height, output_width, **kwargs):


# Path: train_video_classifier.py
import tensorflow as tf
import numpy as np
import time
import os
import math
import async_loader
from datetime import datetime
from tensorflow.python.ops import control_flow_ops
from deployment import model_deploy
from deployment import train_util
from nets import nets_factory
from preprocessing import preprocessing_factory

            'sec/batch)')
    print (format_str % (datetime.now(), num_eval_batches, msg,
                    test_examples_per_sec, test_duration))
    summary_str = sess.run(summary_op)
    summary_writer.add_summary(summary_str, num_eval_batches+1)
    summary_writer.flush()


def test():
    # Check training directory.
    train_dir = FLAGS.train_dir
    if not tf.gfile.IsDirectory(train_dir):
        tf.logging.info("Training directory %s not found.", train_dir)
        return

    # Build the TensorFlow graph.
    g = tf.Graph()
    with g.as_default():
        ####################
        # Select the network #
        ####################
        network_fn = nets_factory.get_network_fn(
                    FLAGS.model_name,
                    num_classes=FLAGS.NUM_CLASSES,
                    is_training=False)

        #####################################
        # Select the preprocessing function #
        #####################################
        preprocessing_name = FLAGS.preprocessing_name or FLAGS.model_name

        image_preprocessing_fn = preprocessing_factory.get_preprocessing(