title: TypeError: Invalid dimensions for image data in tensorflow
body: <p>I am compiling this program and working ok but i have some confusions which i am not getting ,</p>
  
  <p>So far my code is :</p>
  
  <pre><code>import matplotlib.image as mi
  import os
  os.environ["TF_CPP_MIN_LOG_LEVEL"]="3"
  import matplotlib.pyplot as plt
  import tensorflow as tf
  import numpy as np
  image="dd.jpg"
  read=mi.imread(image)
  print(read.shape)
  plac=tf.placeholder("uint8",[None,None,3])
  
  
  slice=tf.slice(read,[500,2000,0],[2000,1,0])
  with tf.Session() as tff:
      use1=tff.run(slice,feed_dict={plac:read})
  
      print(use1.shape)
  
  plt.imshow(use1)
  plt.show()
  </code></pre>
  
  <p>So my doubts are :</p>
  
  <p>what is actually <code>[None, None,3]</code> in </p>
  
  <pre><code>plac=tf.placeholder("uint8",[None,None,3]
  </code></pre>
  
  <p>f i learned correctly then None , None = row , col</p>
  
  <pre><code>placeholder("unit8",[row,col,3] 
  </code></pre>
  
  <p>i understand its a Matrix of unconstrained size</p>
  
  <p>but what is the 3 here ??</p>
  
  <p>second question is if i am using [2000,-1,-1] then its working but if i use [2000,1,0] then its not working so i am not getting why i have to use <code>[-1,-1]</code> ?</p>
  
  <p>edit: I tried this <a href="https://stackoverflow.com/questions/15008045/showing-an-image-with-pylab-imshow">answer</a> <code>plt.imshow(use1.squeeze())</code> but its not working</p>