pythonnumpyimagetensorflow

Tensorflow splitting training data to batches


I have a dataset of images as a Numpy array. (Number of images, length, width, colour range) I would like to split it to batches and feed to tensorflow. What is the good way to do it?


Solution

  • First you could use numpy.split to divide your images into batches (sub-ndarrays). Then you could feed them to the tf.Session using the run function with the feed_dict parameter.

    I'd also highly recommend looking at the TF MNIST tutorial