0

I'm trying to use TensorFlow to train output servo commands given an input image.

I plan on using a file as @mrry suggested in this question, with the images like so:

../some/path/some_img.JPG *some_label*

My question is, what are the label formats I can provide to TensorFlow and what structures are suggested?

My data is basically n servo commands from 0-10 seconds. A vector would work great:

[0,2,4,3]

or similarly:

[0,.25,.4,.3]

I couldn't find much about labels in the docs. Can anyone shed any light on TensorFlow labels?

And a very related question is what is the best way to structure these for TensorFlow to properly learn from them?

Community
  • 1
  • 1
JohnAllen
  • 7,317
  • 9
  • 41
  • 65
  • 1
    For general data formats you can use [tf.parse_example](https://www.tensorflow.org/versions/r0.8/api_docs/python/io_ops.html#parse_example). – Yaroslav Bulatov Apr 29 '16 at 05:11

1 Answers1

1

In Tensorflow Labels are just generic tensor. You can use any kind of tensor to store your labels. In your case a 1-D tensor with shape (4,) seems to be desired.

Labels do only differ from the rest of the data by its use in the computational graph. (Usually) labels should only be used inside the loss function while you propagate the other data through the whole network. For your problem a 4-d regression function should work.

Also, look at my newest comment to the (old) question. Using the slice_input_producer seems to be preferable in your case.

MarvMind
  • 3,366
  • 2
  • 21
  • 19