How to read bmp files in tensorflow?

霸气de小男生 提交于 2019-12-04 06:46:52

问题


I'm trying to read BMP files in TensorFlow in the following way:

reader = tf.TextLineReader()
_, value = reader.read(filename_queue)
filename, label = tf.decode_csv(value, [[''], [0]])

im = tf.decode_raw(tf.read_file(filename), tf.uint8)

The error is the following:

E tensorflow/core/client/tensor_c_api.cc:485] Input to reshape is a tensor with 44200 values, but the requested shape has 750000
       [[Node: batch_processing/Reshape = Reshape[T=DT_UINT8, _device="/job:localhost/replica:0/task:0/cpu:0"](batch_processing/Slice, batch_processing/Reshape/shape)]]
E tensorflow/core/client/tensor_c_api.cc:485] Input to reshape is a tensor with 33871 values, but the requested shape has 750000
       [[Node: batch_processing/Reshape = Reshape[T=DT_UINT8, _device="/job:localhost/replica:0/task:0/cpu:0"](batch_processing/Slice, batch_processing/Reshape/shape)]] 
E tensorflow/core/client/tensor_c_api.cc:485] Input to reshape is a tensor with 47566 values, but the requested shape has 750000     
       [[Node: batch_processing/Reshape = Reshape[T=DT_UINT8, _device="/job:localhost/replica:0/task:0/cpu:0"](batch_processing/Slice, batch_processing/Reshape/shape)]]

Why does the output of tf.decode change? How can I solve the problem?

Any help would be appreciated.

来源:https://stackoverflow.com/questions/39604530/how-to-read-bmp-files-in-tensorflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!