title: Dynamic batch size in tensorflow
body: <p>I have built a classifier using tesnorflow. I generate proposal regions from images and those proposals are individually classified by my classifier.</p>
  
  <p>My problem is that I do not have a constant batch size when evaluating my model. Because every image has a different number of proposals, the number of proposals to be evaluated for every image is not constant.</p>
  
  <p>Right now I have set the batch size to 1, but this is inefficient and limits the processing speed of my classifier. </p>
  
  <p>Below is the placeholder for the input to the model</p>
  
  <pre><code>self.image_op = tf.placeholder(tf.float32, shape=[batch_size, 48, 48, 3], name='input_image')
  </code></pre>
  
  <p>And this is how I feed the input to the model</p>
  
  <pre><code>def predict(self,image):
      cls_prob = self.sess.run([self.cls_prob], feed_dict={self.image_op: image})
      return cls_prob
  </code></pre>
  
  <p>Is there any way of setting the batch size to a dynamic value without having to restore the model for every image?</p>