atriumlts / subpixel

subpixel: A subpixel convnet for super resolution with Tensorflow
MIT License
2.13k stars 301 forks source link

_phase_shift does not generalize to batchsize 1 #22

Closed imayukh closed 7 years ago

imayukh commented 7 years ago

The following lines line 12 X = tf.concat(2, [tf.squeeze(x) for x in X]) # bsize, b, a*r, r line 14 X = tf.concat(2, [tf.squeeze(x) for x in X]) # bsize, a*r, b*r

in subpixel.py cause the first dimension to be dropped when the batch size is one. In fact, line 12 causes the dimension drop and line 14 throws an error.

I propose the following change: X = tf.concat(2, [tf.squeeze(x, axis = 1) for x in X]) # bsize, b, a*r, r X = tf.concat(2, [tf.squeeze(x, axis = 1) for x in X]) # bsize, a*r, b*r

goldsmith commented 7 years ago

fixed in https://github.com/Tetrachrome/subpixel/pull/23