【发布时间】:2015-12-18 13:27:57
【问题描述】:
本题基于:Tensorflow image reading & display
按照他们的代码,我们有以下内容:
string = ['/home/user/test.jpg']
filepath_queue = tf.train.string_input_producer(string)
self.reader = tf.WholeFileReader()
key, value = self.reader.read(filepath_queue)
print(value)
# Output: Tensor("ReaderRead:1", shape=TensorShape([]), dtype=string)
my_img = tf.image.decode_jpeg(value, channels=3)
print(my_img)
# Output: Tensor("DecodeJpeg:0", shape=TensorShape([Dimension(None), Dimension(None), Dimension(3)]), dtype=uint8)
为什么my_img 没有维度? (Dimension(3) 只是因为参数channels=3)
这是否意味着图像未正确加载? (img = misc.imread('/home/user/test.jpg') 确实会加载该图像)。
【问题讨论】:
标签: tensorflow