I want to read more than just numeric functions and labels from each line of the input CSV data file. My functions and shortcuts are numeric, but I also want to use a date or line type identifier for each line, so I can go back to the line after a random shuffle sequence has been read.
Since TensorFlow requires an array record_defaultsthat I prepopulate programmatically, how can I make TF read mixed types on one line? If I pre-populate record_defaultswith float, I get an error message for cells that contain dates / rows. If I pre-fill the lines record_defaultswith lines, with the form of casting numeric parts later into floats, I get an error message that TF does not support casting lines in swimming.
Status of documents:
A list of Tensor objects with types from: float32, int32, int64, string. One tensor per column of the input record, either the scalar default value for this column, or empty if a column is required
As stated above, how can I specify โemptyโ if I just want all columns to be needed and skip all the headaches by default? And then, how does TF know which data types are automatically selected for each cell? I have many columns, so it is impractical to write them one by one, as is done in one example in the docs:
record_defaults = [[1], [1], [1], [1], [1]]
(I have hundreds of cells!)
My code looks something like this:
rDefaults = [[0.02] for row in range((300))]
reader = tf.TextLineReader(skip_header_lines=False)
_, csv_row = reader.read(filename_queue)
data = tf.decode_csv(csv_row, record_defaults=rDefaults)
dateLbl = tf.slice(data, [0], [TD])
features = tf.slice(data, [TD], [TS])
label = tf.slice(data, [TS], [TL])
Thanks for any input!