title: Deep Learning With TensorFlow and Cifar10
body: <blockquote>
  <p>I can't figure out how to make my code working. And i'm looking for help :)
  And i'm working with cifar10 images classification.Using Tensorflow 1.x version
  Line 40 is sess.run(train_step,feed_dict={x : x_train , y_ : y_train})</p>
  </blockquote>
  <pre><code>import tensorflow as tf
  import numpy as np
  from tensorflow.keras.datasets import cifar10, mnist
  (x_train,y_train),(x_test,y_test) = cifar10.load_data()
  x = tf.placeholder(tf.float32,[None,3072])
  y_ = tf.placeholder(tf.float32,[10])
  # Data normalization
  x_train = x_train/255
  y_train = y_train/255
  # four hidden layers
  (hidden1_size,hidden2_size,hidden3_size,hidden4_size) = (100,100,100,100)
  W1 = tf.Variable(tf.truncated_normal([3072,hidden1_size],stddev=0.1))
  b1 = tf.Variable(tf.constant(0.1,shape=[hidden1_size]))
  z1 = tf.nn.relu(tf.matmul(x,W1)+b1)
  W2 = tf.Variable(tf.truncated_normal([hidden1_size,hidden2_size],stddev=0.1))
  b2 = tf.Variable(tf.constant(0.1,shape=[hidden2_size]))
  z2 = tf.nn.relu(tf.matmul(z1,W2)+b2)
  W3 = tf.Variable(tf.truncated_normal([hidden2_size,hidden3_size],stddev=0.1))
  b3 = tf.Variable(tf.constant(0.1,shape=[hidden3_size]))
  z3 = tf.nn.relu(tf.matmul(z2,W3)+b3)
  W4 = tf.Variable(tf.truncated_normal([hidden3_size,hidden4_size],stddev=0.1))
  b4 = tf.Variable(tf.constant(0.1,shape=[hidden4_size]))
  z4 = tf.nn.relu(tf.matmul(z3,W4)+b4)
  W5 = tf.Variable(tf.truncated_normal([hidden4_size,10],stddev=0.1))
  b5 = tf.Variable(tf.constant(0.1,shape=[10]))
  y = tf.nn.softmax(tf.matmul(z4,W5)+b5)
  # this is a cross entropy
  cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y)))
  # let's train to get the minimum loss using back+forward propagation
  train_step = tf.train.GradientDescentOptimizer(0.001).minimize(cross_entropy)
  init = tf.global_variables_initializer()
  sess = tf.Session()
  sess.run(init)
  correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))
  accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
  for i in range(1000):
      for j in range (100):
          sess.run(train_step,feed_dict={x : x_train , y_ : y_train})
  </code></pre>
  <blockquote>
  <p>my output is File &quot;C:/Users/איימן/PycharmProjects/pythonProject1/aiman.py&quot;, line 40, in 
  sess.run(train_step,feed_dict={x : x_train , y_ : y_train})
  File &quot;C:\Users\איימן\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py&quot;, line 956, in run
  run_metadata_ptr)
  File &quot;C:\Users\איימן\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py&quot;, line 1156, in _run
  (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
  ValueError: Cannot feed value of shape (50000, 32, 32, 3) for Tensor 'Placeholder:0', which has shape '(?, 3072)'</p>
  </blockquote>