These are chat archives for arita37/tensorflow

Jul 2017
Jul 26 2017 03:22
Anybody compiled static libraries (libtensorflow.a) for Android ?
Trevor R.H. Clarke
Jul 26 2017 18:31
trying to write an input pipeline for some data in tf 1.2 python. I have a file format that has 3 bytes (number as string) followed by PNG data (variable length). I'm using the cifar10 tutorial as a starting point.
I have a filename queue which I put into a wholefilereader and .read() to get the filename, raw_data. I do tf.string_to_number(tf.substr(raw_data, 0, 3), tf.int32) to get the numeric value (it's the class number for the image)
having trouble getting the png data. tried tf.image.decode_png(tf.substr(raw_data, 3, -1)) and it said the -1 wasn't a valid index. Next I tried tf.image.decode_png(tf.substr(raw_data, 3, string_length(raw_data)) where string_length is
def string_length(t): return tf.py_func(lambda p: [len(x) for x in p], [t], [tf.int32])[0]
with that I get ValueError: Shape must be rank -1 but is rank 0 for 'Substr' (op: 'Substr') with input shapes: [], [], ?.
I'm guessing that might mean that my rank 0 int32 tensor can't be used? I don't want to pass in a session and eval() the string_length result forcing the whole input pipe to eval at that point. How else can I do this?