Closed nwpuqyj closed 4 years ago
Sorry I cannot check code line-by-line.
Make sure you are using gray
model.
And make sure the input to this line:
deblur = sess.run(outputs, feed_dict={inputs: blurPad / 255.0})
blurPad
should have the correct shape, that is [batch, height, width, channel = 1].
If so, the inference should be correct.
Sometimes, your image seems gray-scale, but it has actually 3-channels. So please make sure, the shapes of each step are all as you expected.
Hope it helps.
@jiangsutx Thank you for your reply! As you said ,in the code: deblur = sess.run(outputs, feed_dict={inputs: blurPad / 255.0}) I have set channel to 1 to satisfy [batch, height, width, channel = 1],and what should batch_size be set to?I see your original code: self.batch_size = 1 if self.args.model == 'color' else 3 When i set batch_size to 3 to satisfy [3,h,w,1],the code has something wrong..however,when i set batch_size to 1,[batch, height, width, channel] satisfies [1,h,w,1],and the code can work!Both inputs and blurPad have the same dimensions [3,h,w,1] or [1,h,w,1],but i don't know how to choose the value of batch_size..
color
model takes RGB channel at once, so shape is [1, height. width, 3]
as input.
b) gray
model take single channel image as input, and RGB has 3 channels, so we separate it into 3 images and put them in batch channel. so input size is [3, height, width, 1]
.gray
model, so input should be [1, height, width, 1]
.Hope it is clear.
@jiangsutx Thanks a lot! it is very clear!
Thank you for your code! My question is that Could you please help me to see if my modified code is correct? I modified the "test" function in model.py to test grayscale images. The code can be run after modification. But I'm not sure if the details are correct....The modified part of the code has been marked with "Here!". Looking forward to your reply!