12dmodel / deep_motion_mag

Tensorflow implementation of Learning-based Video Motion Magnification
MIT License
454 stars 131 forks source link

Got demension mismatch during testing #8

Closed DennisBang closed 5 years ago

DennisBang commented 5 years ago

I have got a really wired issue during testing, the dimension got a mismatch during enc = tf.concat([texture_enc, shape_enc], axis=3) and the mistake information is InvalidArgumentError (see above for traceback): ConcatOp : Dimensions of inputs should match: shape[0] = [1,84,68,32] vs. shape[1] = [1,83,68,32] [[Node: ynet_3frames/decoder/concat = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](ynet_3frames/decoder/Relu, ynet_3frames/manipulator/add_1, ynet_3frames/decoder/concat/axis)]]

iyah4888 commented 5 years ago

You need to guarantee that the input size is a multiple of 4. The subsampling and upsampling operations in the middle can yield such mismatch when the input resolution has an odd number or so.

On Sat, Mar 16, 2019 at 4:18 AM Zhang notifications@github.com wrote:

I have got a really wired issue during testing, the dimension got a mismatch during enc = tf.concat([texture_enc, shape_enc], axis=3) and the mistake information is InvalidArgumentError (see above for traceback): ConcatOp : Dimensions of inputs should match: shape[0] = [1,84,68,32] vs. shape[1] = [1,83,68,32] [[Node: ynet_3frames/decoder/concat = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](ynet_3frames/decoder/Relu, ynet_3frames/manipulator/add_1, ynet_3frames/decoder/concat/axis)]]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/12dmodel/deep_motion_mag/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AG_QgrEA3TuGmqySH0Z2AtZW891izDZfks5vXKjagaJpZM4b3rqI .

12dmodel commented 5 years ago

The quickest fix is as Tae-Hyun suggests. This is caused by integer division of image dimension when we downsample and upsample. If instead of upsampling by a factor of 2, you explicitly give the size of the desired output, it should also work.