title: How to prepare a dataset of images to train and test tensorflow
body: <p>I am using Windows 10 pro, Visual Studio 10, Python 3.6.2rc1 and Tensorflow. I am trying to build a convolutional neural network (CNN) to classify images of fruits with Tensorflow. I have only two fruits, pineapple and banana. It's less than a week I am working with python and this is my first experience.</p>
  
  <p>I made 2 folders, one for training images with same size images with jpg format, and another for test images also with jpg format. I have also two txt one for training and one for test. As an example, data in my training set is like this:</p>
  
  <pre><code>image001 banana
  
  image002 pineapple
  </code></pre>
  
  <p>I don't know how to feed these data into a sample network. I used the exact network from</p>
  
  <p><a href="https://github.com/tensorflow/tensorflow/blob/r1.2/tensorflow/examples/tutorials/layers/cnn_mnist.py" rel="nofollow noreferrer">https://github.com/tensorflow/tensorflow/blob/r1.2/tensorflow/examples/tutorials/layers/cnn_mnist.py</a> </p>
  
  <p>and read the tutorial at tensorflow for both reading data and the explanation of the above code at:</p>
  
  <p><a href="https://www.tensorflow.org/tutorials/layers" rel="nofollow noreferrer">https://www.tensorflow.org/tutorials/layers</a></p>
  
  <p>My biggest problem is I don't understand how MNIST is fed into this network and couldn't really figure out by using what is written at tensorflow site in programmers_guide/reading_data.</p>
  
  <p>I would really appreciate if you can give me more concrete guidance regarding what I need to do to feed the images of these two folders and the two text files into the above network. Also since I'm quite new to python, I am not very familiar with it yet, to know what I must import for doing so. Thank you very much in advance.</p>