title: Tensorflow, Cannot feed value of shape ..... for Tensor
body: <p>I have a problem with linear regression and 3d matrices.
  They are all floating point numbers, with labels.</p>
  
  <p>I got started from this code but I changed the matrix: 
  <a href="https://aqibsaeed.github.io/2016-07-07-TensorflowLR/" rel="nofollow noreferrer">https://aqibsaeed.github.io/2016-07-07-TensorflowLR/</a></p>
  
  <p>With 2 dimensions, it is working well but, with 3, I can not get it running.</p>
  
  <p>this is the shape</p>
  
  <pre><code>(387, 7, 10) shape train_x
  (387, 1) shape train_x
  (43, 7, 10) test_x.shape
  (43, 1) test_y.shape
  </code></pre>
  
  <p></p>
  
  <pre><code>n_dim = f.shape[1]
  train_x, test_x, train_y, test_y = train_test_split(f,l,test_size=0.1, shuffle =False)
  print(train_x.shape)
  print(train_y.shape)
  print(test_x.shape)
  print(test_y.shape)
  learning_rate = 0.01
  training_epochs = 1000
  cost_history = np.empty(shape=[1],dtype=float)
  
  X = tf.placeholder(tf.float32,[None,n_dim])
  Y = tf.placeholder(tf.float32,[None,1])
  W = tf.Variable(tf.ones([n_dim,1]))
  
  #init = tf.initialize_all_variables()
  init = tf.global_variables_initializer()
  
  y_ = tf.matmul(X, W)
  cost = tf.reduce_mean(tf.square(y_ - Y))
  training_step = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost)
  
  
  sess = tf.Session()
  sess.run(init)
  
  for epoch in range(training_epochs):
      sess.run(training_step,feed_dict={X:train_x,Y:train_y})
      cost_history = np.append(cost_history,sess.run(cost,feed_dict={X: train_x,Y: train_y}))
  
      plt.plot(range(len(cost_history)),cost_history)
  plt.axis([0,training_epochs,0,np.max(cost_history)])
  plt.show()
  
  pred_y = sess.run(y_, feed_dict={X: test_x})
  mse = tf.reduce_mean(tf.square(pred_y - test_y))
  print("MSE: %.4f" % sess.run(mse)) 
  
  fig, ax = plt.subplots()
  ax.scatter(test_y, pred_y)
  ax.plot([test_y.min(), test_y.max()], [test_y.min(), test_y.max()], 'k--', lw=3)
  ax.set_xlabel('Measured')
  ax.set_ylabel('Predicted')
  plt.show()
  
   &lt;/ blink&gt;
  
  this is the mistake
  
  
  
  
    \session.py", line 1100, in _run
          % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
  
      ValueError: Cannot feed value of shape (387, 7, 10) for Tensor 'Placeholder_12:0', which has shape '(?, 7)'
  </code></pre>