title: Deep learning with Tensrorflow and cifar10
body: <p>I am trying to classify cifar10 images with softmax but the model is not learning anything.</p>
  <p>the code below prints</p>
  <pre><code> 0 None
   1 None 
   2 None 
  </code></pre>
  <p>And so on. How can i fix my code or figure out why it's always None?</p>
  <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,[None])
  x_train = x_train.astype('float32')
  x_test = x_test.astype('float32')
  #reshaping the y_train and x_train
  y_train = y_train.reshape((5000,10))
  x_test =x_test.reshape(10000,3072)
  x_train = x_train.reshape(50000,3072)
  y_test =y_test.reshape(1000,10)
  
  # Data normalization
  x_train = x_train/255
  y_train = y_train/255
  W1 = tf.Variable(tf.zeros([3072,10]))
  b1 = tf.Variable(tf.zeros([10]))
  y = tf.nn.softmax(tf.matmul(x,W1)+b1)
  # this is a cross entropy
  cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y),reduction_indices=[1]))
  # let's train to get the minimum loss using back+forward propagation
  train_step = tf.train.AdamOptimizer(0.5).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(50):
         print(j,sess.run(train_step,feed_dict={x : x_train , y_ : y_train[j]}))
  </code></pre>