Old_Mortality
Old_Mortality

Reputation: 519

How do I get my images into Tensorflow?

I am new to Tensorflow, and I am following the Mnist simple tutorial. Now I would like to do something similar with my own images. I cannot figure out how to do that. The tutorial does this:

  batch_xs, batch_ys = mnist.train.next_batch(100)

What precisely should batch_xs, batch_ys be when I create it from my images?

I see there is a library ImageFlow, and this seems to do exactly what I want, but I cannot figure out how to use that either. The description says I should call

  convert_images(images, labels, filename)

but that does not even contain a path to my images.

Many thanks for your attention.

Upvotes: 2

Views: 233

Answers (1)

mrry
mrry

Reputation: 126194

Looking at the implementation of mnist.train.next_batch(), it appears that batch_xs should be a matrix of size batch_size x num_pixels, and batch_ys should be either a matrix of size batch_size x num_classes (if one_hot is True) or a vector of length batch_size (otherwise).

When you call mnist.train.next_batch(100), batch_xs will be 100 x 784, and batch_ys will be 100 x 10. For your own application you will probably want to change both the number of pixels and the number of classes.

Upvotes: 2

Related Questions