title: TensorFlow - Dynamic Input Batch Size?
body: <p>In my case, I need to dynamically change the batch_size during training. For example, I need to double the batch_size for every 10 epochs. However, the problem is that, although I know how to make it dynamic, in <strong><em>input pipeline</em></strong> I have to determine the batch size, as the following code shows. That is, to use <code>tf.train.shuffle_batch</code> I have to determine the <code>batch_size</code> argument, and I do not find any ways to change it afterward. Therefore, I would appreciate any suggestions! How do you make a dynamic input batch?</p>
  
  <pre><code>  filename_queue = tf.train.string_input_producer([self.tfrecords_file])
    reader = tf.TFRecordReader()
  
    _, serialized_example = self.reader.read(filename_queue)
    features = tf.parse_single_example(
        serialized_example,
        features={
          'image/file_name': tf.FixedLenFeature([], tf.string),
          'image/encoded_image': tf.FixedLenFeature([], tf.string),
        })
  
    image_buffer = features['image/encoded_image']
    image = tf.image.decode_jpeg(image_buffer, channels=3)
    image = self._preprocess(image)
    images = tf.train.shuffle_batch(
          [image], batch_size=self.batch_size, num_threads=self.num_threads,
          capacity=self.min_queue_examples + 3*self.batch_size,
          min_after_dequeue=self.min_queue_examples
        )
  </code></pre>