def ReadInput(data_filepattern, shuffle, params):
 image_size = params['image_size']
 filenames = tf.gfile.Glob(data_filepattern)
 filename_queue = tf.train.string_input_producer(filenames, shuffle=shuffle)
 reader = tf.TFRecordReader()
 (_, example) = reader.read(filename_queue)
 feature_sepc = {'moving_objs': tf.FixedLenSequenceFeature(shape=[((image_size * image_size) * 3)], dtype=tf.float32)}
 (_, features) = tf.parse_single_sequence_example(example, sequence_features=feature_sepc)
 moving_objs = tf.reshape(features['moving_objs'], [params['seq_len'], image_size, image_size, 3])
 if shuffle:
  examples = tf.train.shuffle_batch([moving_objs], batch_size=params['batch_size'], num_threads=64, capacity=(params['batch_size'] * 100), min_after_dequeue=(params['batch_size'] * 4))
 else:
  examples = tf.train.batch([moving_objs], batch_size=params['batch_size'], num_threads=16, capacity=params['batch_size'])
 examples /= params['norm_scale']
 return examples

def ReadInput ( data_filepattern , shuffle , params ) : image_size = params [ 'image_size' ] filenames = tf . gfile . Glob ( data_filepattern ) filename_queue = tf . train . string_input_producer ( filenames , shuffle = shuffle ) reader = tf . TFRecordReader ( ) ( _ , example ) = reader . read ( filename_queue ) feature_sepc = { 'moving_objs' : tf . FixedLenSequenceFeature ( shape = [ ( ( image_size * image_size ) * 3 ) ] , dtype = tf . float32 ) } ( _ , features ) = tf . parse_single_sequence_example ( example , sequence_features = feature_sepc ) moving_objs = tf . reshape ( features [ 'moving_objs' ] , [ params [ 'seq_len' ] , image_size , image_size , 3 ] ) if shuffle : examples = tf . train . shuffle_batch ( [ moving_objs ] , batch_size = params [ 'batch_size' ] , num_threads = 64 , capacity = ( params [ 'batch_size' ] * 100 ) , min_after_dequeue = ( params [ 'batch_size' ] * 4 ) ) else : examples = tf . train . batch ( [ moving_objs ] , batch_size = params [ 'batch_size' ] , num_threads = 16 , capacity = params [ 'batch_size' ] ) examples /= params [ 'norm_scale' ] return examples
read the tf .