title: How to train CNN with an RGB Image
body: <p>I am currently building a CNN to differentiate between a rotten apple and a normal apple. I feel that it would be of great benefit if I could feed the CNN with rgb images. However, what exactly do I need to change to the following network?</p>
  
  <pre><code> x = tf.placeholder('float', [None, 784])
  #y = tf.placeholder(tf.float32, shape=(), name="init")
  y = tf.placeholder('int32')
  
  keep_rate = 0.8
  keep_prob = tf.placeholder(tf.float32)
  
  def conv2d(x, W):
      return tf.nn.conv2d(x, W, strides=[1,1,1,1], padding='SAME')
  
  def maxpool2d(x):
      #                        size of window         movement of window
      return tf.nn.max_pool(x, ksize=[1,2,2,1], strides=[1,2,2,1], padding='SAME')
  
  
  
  def convolutional_neural_network(x):
      weights = {'W_conv1':tf.Variable(tf.random_normal([5,5,1,32])),
                 'W_conv2':tf.Variable(tf.random_normal([5,5,32,64])),
                 'W_fc':tf.Variable(tf.random_normal([7*7*64,1024])),
                 'out':tf.Variable(tf.random_normal([1024, n_classes]))}
  
      biases = {'b_conv1':tf.Variable(tf.random_normal([32])),
                 'b_conv2':tf.Variable(tf.random_normal([64])),
                 'b_fc':tf.Variable(tf.random_normal([1024])),
                 'out':tf.Variable(tf.random_normal([n_classes]))}
  
      x = tf.reshape(x, shape=[-1, 28, 28, 1])
  
      print("test")
      print(x)
      conv1 = tf.nn.relu(conv2d(x, weights['W_conv1']) + biases['b_conv1'])
      conv1 = maxpool2d(conv1)
  
      conv2 = tf.nn.relu(conv2d(conv1, weights['W_conv2']) + biases['b_conv2'])
      conv2 = maxpool2d(conv2)
  
      fc = tf.reshape(conv2,[-1, 7*7*64])
      fc = tf.nn.relu(tf.matmul(fc, weights['W_fc'])+biases['b_fc'])
      fc = tf.nn.dropout(fc, keep_rate)
  
      output = tf.matmul(fc, weights['out'])+biases['out']
      return output
  </code></pre>
  
  <p>I have tried to change certain values however I continuously get one error after another. This network is currently meant to take 28 by 28 channel 1 grayscale images. </p>