I have a dataset images and corresponding labels, where to each image file there is a .txt file which contains the one hot encoding:
0
0
0
0
1
0
My code looks something like this:
imageString = tf.read_file('image.jpg')
imageDecoded = tf.image.decode_jpeg(imageString)
labelString = tf.read_file(labelPath)
# decode csv string
but labelString looks like this:
tf.Tensor(b'0\n0\n0\n0\n1\n', shape=(), dtype=string)
Is there a way to transform this into an array of numbers inside tensorflow?