Skip to content Skip to sidebar Skip to footer

Tensorflow Batch: Keep Result As Strings

This simple program import tensorflow as tf input = 'string' batch = tf.train.batch([tf.constant(input)], batch_size=1) with tf.Session() as sess: tf.train.start_queue_runners

Solution 1:

The problem is that output is a bytes object, because TensorFlow tf.string tensors are indeed made of bytes. But then you are trying to use split with a str separator, and that is why it complains. Try:

output.split(b'i')

or:

output.decode().split('i')

Post a Comment for "Tensorflow Batch: Keep Result As Strings"