1

I wonder if there are any way to print the input queue in datatype of tensor list.

import tensorflow as tf

image=tf.cast(image,tf.string)#list of input image directory
label=tf.cast(label,tf.int32) #list of input image label

input_queue=tf.train.slice_input_producer([image,label])

with tf.Session() as session:
     print(session.run(input_queue))

If print input_queue in this way, the program keeps on runnning and won't show any response.

kmario23
  • 57,311
  • 13
  • 161
  • 150
Cristina
  • 31
  • 1
  • can you please add some sample entries for the tensors `image` and `label`? So that I can work on a solution. Just a couple of entries is fine. – kmario23 Dec 26 '17 at 06:41
  • Also, see this answer will help: https://stackoverflow.com/questions/43567552/tf-slice-input-producer-not-keeping-tensors-in-sync – kmario23 Dec 26 '17 at 06:50
  • You could refer to this [script]( https://github.com/kevin28520/My-TensorFlow-tutorials/blob/master/01%20cats%20vs%20dogs/input_data.py) and I just cited from line 97. Thank you :) @kmario23 – Cristina Dec 26 '17 at 08:08
  • If you try to print it after you read using `tf.read_file()`, then it'll work I guess. Because these images has to be read from your directory. – kmario23 Dec 26 '17 at 08:13

1 Answers1

0

You can use eval() function to get the tensor. For your code, you can use print(input_queue.eval()) to print the 'input_queue'.

hdD
  • 81
  • 4