title: Why won't placeholder work in tensorflow?
body: <p>When I try to run a simple statement using tf.placeholder() I get the result below.</p>
  
  <pre><code>X=tf.placeholder(tf.float32,shape=(None,height,width,channels))
  Traceback (most recent call last):
  
    File "&lt;ipython-input-6-6f535655ed45&gt;", line 1, in &lt;module&gt;
      X=tf.placeholder(tf.float32,shape=(None,height,width,channels))
  
  AttributeError: module 'tensorflow' has no attribute 'placeholder'
  </code></pre>
  
  <p>After doing some reading it seems this can be related to having version 2 of tensorflow rather than an earlier version. But I checked and it appears I have 1.14.</p>
  
  <pre><code>pip list
  Package                            Version            
  ---------------------------------- -------------------
  tensorboard                        1.14.0             
  tensorboard-plugin-wit             1.6.0.post3        
  tensorflow                         1.14.0             
  tensorflow-estimator               1.14.0 
  </code></pre>
  
  <p>I am very new to this and was trying to follow a tutorial from a book, any help is appreciated. For context I'm attempting to run this in Spyder as a part of the Anaconda distribution for Python 3.7.</p>
  
  <p>Edit: I forgot to include my attempts at using some version of tf.compat.placeholder() as well.</p>
  
  <pre><code>X = tf.compat.v1.placeholder(tf.float32,shape=(None,height,width,channels))
  Traceback (most recent call last):
  
    File "&lt;ipython-input-7-d9a798a5972c&gt;", line 1, in &lt;module&gt;
      X = tf.compat.v1.placeholder(tf.float32,shape=(None,height,width,channels))
  
  AttributeError: module 'tensorflow' has no attribute 'compat'
  </code></pre>
  
  <p>Edit 2: After more testing, the code will run in Jupyter but not in Spyder, so I'm not sure what that means.</p>