The input to my network comes from files containing int32's. They are stored as .tfrecords as follows:
writer = tf.python_io.TFRecordWriter(output_file)
with tf.gfile.FastGFile(file_path, 'rb') as f:
data = f.read()
example = tf.train.Example(features=tf.train.Features(feature={
'data': tf.train.Feature(bytes_list=tf.train.BytesList(value=[data])) }))
writer.write(example.SerializeToString())
I then read the tfrecords file like so:
with tf.name_scope(self.name):
filename_queue = tf.train.string_input_producer([path])
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
features = tf.parse_single_example(
serialized_example,
features={ 'data': tf.FixedLenFeature([], tf.string) })
data = features['data']
After reading tfrecords I have string tensors like this:
Tensor("X/ParseSingleExample/ParseSingleExample:0", shape=(), dtype=string)
I would like to first convert this to int32's as that is what the initial data represents. After that I need to end up with a tensor of floats, can someone point me in the right direction?
PS Im new to tensorflow, please let me know if I can provide more useful information