I\'m trying to stack 2 layers of tf.nn.conv2d_transpose()
to up-sample a tensor. It works fine during feed forward, but I get an error during backward propagation:
I guess you need to change your 'stride' paramter in conv2d_transpose. conv2d_transpos
is like conv2d
but input and output are reversed.
For conv2d
, the stride
and input shape will decide the output shape. For conv2d_transpose
, the stride
and output shape will decide the input shape. Now your stride is [1 1 1 1], which means output and input of conv2d_transpose
is about same (ignoring boundary effect).
For input H = W = 100, stride = [1 2 2 1]
, the output of conv2d_tranpose
should be 200. (reversed of conv2d
), if you set the padding
to SAME. In short, input, output and stride need to be compatible.