-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to read the image.list by pipeline #7
Comments
As you can see from the error
The file Check the content of (the |
hi, import os
import tensorflow as tf
filename = "/Users/liuguiyang/Documents/CodeProj/PyProj/dtb/scripts/inputs/data/airplane/positive/32size/0335.png"
def test02():
# filename = "/Users/liuguiyang/Desktop/cifar/test/0_cat.png"
with tf.Graph().as_default():
image_contents = tf.read_file(filename)
image = tf.image.decode_png(image_contents, channels=3)
init_op = tf.tables_initializer()
with tf.Session() as sess:
sess.run(init_op)
tmp = sess.run(image)
print(tmp)
if __name__ == "__main__":
test02() the answer is below: ➜ dtb git:(CAE) ✗ python3 run.py > a.txt
➜ dtb git:(CAE) ✗ more a.txt
[[[173 173 173]
[173 173 173]
[173 173 173]
...,
[176 176 176]
[100 100 100]
[117 117 117]]
[[175 175 175]
[174 174 174]
[173 173 173]
...,
[177 177 177]
[149 149 149]
[136 136 136]]
[[175 175 175]
[173 173 173]
[171 171 171]
...,
[173 173 173]
[173 173 173]
[161 161 161]]
...,
[[173 173 173]
[173 173 173]
[172 172 172]
...,
[174 174 174]
[173 173 173]
[173 173 173]]
[[173 173 173]
[173 173 173]
[173 173 173]
...,
[152 152 152]
[171 171 171]
[170 170 170]]
[[172 172 172]
[172 172 172]
[172 172 172]
...,
[146 146 146]
[170 170 170]
[173 173 173]]] it really can read the image data. |
Your input pipeline was correct (the commented part, not the modified version you posted here with comments added and debug operations added), the only problem I see is in the image.list file content. The image you read here does not have the :1 added at the end and the read operation worked well. Thus if every file listed in image.list exists everything should work fine |
hi, import tensorflow as tf
filename_queue = tf.train.string_input_producer(
tf.train.match_filenames_once("/Users/liuguiyang/Documents/CodeProj/PyProj/dtb/scripts/inputs/data/airplane/positive/32size/*.png")
)
image_reader = tf.WholeFileReader()
key, img_file = image_reader.read(filename_queue)
img = tf.image.decode_png(img_file)
with tf.Session() as sess:
tf.global_variables_initializer().run()
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
img_tensor = sess.run([img])
print(img_tensor)
coord.request_stop()
coord.join(threads=threads) thank you for your help ? |
hi,
I sorry to bother you.
I want to make my own dataset, but there is a problem that hold me the whole day. This is the code
The Error Info Msg is:
please give me some info.
guiyang, thx!
The text was updated successfully, but these errors were encountered: