Closed xu-feiran closed 4 years ago
Three options have been given in the original code. If they are not color options, they all have to be grayscale and then processed. Is the grayscale image that you enter directly?
According to the last line of error code, the TensorFlow data pipeline cannot read image data.
Maybe you provide the wrong path to images, or maybe your data fail to pass preprocessing part.
Please check https://github.com/jiangsutx/SRN-Deblur/blob/master/models/model.py#L37-L63 And TensorFlow data pipeline is really hard to debug.
Please check https://github.com/jiangsutx/SRN-Deblur/blob/master/models/model.py#L39-L41
It seems that you are using newer version of TensorFlow and make sure tf.image_decode
has correct parameters.
Thank you for your reply! I'm sure that the path of images are right, because the code runs well with RGB images. The code runs with tensorflow-gpu 1.4.0. I fork this repository and uploaded my dataset at SRN-Deblur. Would you like to help me to debug the code? I will be very appreciate.
1.Option"model" should be "gray" 2.Training set should be grayscale images.
def input_producer(self, batch_size=10):
def read_data():
img_a = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[0]])),
channels=0)
img_b = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[1]])),
channels=0)
I have trained grayscale images successfully.
1.Option"model" should be "gray" 2.Training set should be grayscale images.
- "Channels"should be 3 not 0.
def input_producer(self, batch_size=10): def read_data(): img_a = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[0]])), channels=0) img_b = tf.image.decode_image(tf.read_file(tf.string_join(['./training_set/', self.data_queue[1]])), channels=0)
I have trained grayscale images successfully.
Thanks, I used grayscale images, set Channels to 0 and set model =gray. The error may caused by my images' encoding. I will try it. You help me a lot!
The code is no error, my dataset has some problems. The code runs well with another dataset. Thank you!
I'm sorry for asking this stupid question, I have tried for so many days, but I can't figure it out. I can ask no one in my laboratory, I wish someone could help me, thank you!
model.py
error infomation