这个问题基于:Tensorflow图像读取和显示
遵循他们的代码,我们有以下内容:
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)
Run Code Online (Sandbox Code Playgroud)
为什么my_img没有尺寸?(Dimension(3)仅仅是因为参数channels=3)
这是否意味着图像没有正确加载?(img = misc.imread('/home/user/test.jpg')确实加载该图像).
tensorflow ×1