title: TypeError: unsupported operand type(s) for /: 'NoneType' and 'int', for extract_image_patches
body: <p>I am using extract_image_patches for my image dataset which has dynamic dimensions.</p>
  
  <p>I am getting following error log :</p>
  
  <pre><code> array_grad.py", line 604, in _ExtractImagePatchesGrad     rows_out = int(ceil(rows_in / stride_r))
  TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
  </code></pre>
  
  <p>I tried using</p>
  
  <p>1) <strong>image.set_shape</strong> method </p>
  
  <p>2) image <strong>resizing_using_crop_or_pad</strong> to avoid it, but still the error persists.</p>
  
  <p><strong>Update1</strong>: Following is the code snippet</p>
  
  <pre><code>#######
  #shape=[batch_size,height,width, target_size2
  
  out_processed_model2 =tf.reshape(out_processed2, shape = [tf.shape(image_patch_tf2)[0], tf.shape(image_patch_tf2)[1], tf.shape(image_patch_tf2)[2], target_size2]) 
  
  #PostProcessing
  
  as0, as1, as2, as3, as4, as5= tf.split(out_processed_model2, target_size, 0)
  out_model2_batch_to_depth = tf.concat([as0, as1, as2, as3, as4, as5],3)
  #Model-3 Preprocessing
  
  s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15,s16, s17, s18, s19= tf.split(out_model2_batch_to_depth , target_size2, 3)
  A_3= tf.concat([s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15,s16, s17, s18, s19],1)
  out_model2_depth_to_batch=tf.reshape(A_3, [tf.shape(image_patch_tf2)[0]*target_size2, tf.shape(image_patch_tf2)[1], tf.shape(image_patch_tf2)[2], 1])
  ############################Model -3#######################
  stride_h3= 2
  stride_w3 = 4
  cell3 = 50
  target_size3 = 80
  input_size3 =stride_h3*stride_w3
  image_patch_tf3 = tf.extract_image_patches(images = out_model2_depth_to_batch, ksizes = [1, stride_h3, stride_w3, 1], strides = [1, stride_h3, stride_w3, 1], rates = [1,1,1,1], padding="SAME", name="Extract_Image_Patches3")
  </code></pre>