Deconvolutions/Transpose_Convolutions 使用张量流

Deconvolutions/Transpose_Convolutions with tensorflow

我正在尝试使用 tf.nn.conv3d_transpose,但是,我收到一条错误消息,指出我的过滤器和输出形状不兼容。

最终,我想要 [1,32,32,7,"does not matter"] 的输出形状,但我正在尝试首先使用一个简单的案例。

由于这些张量在常规卷积中是兼容的,我相信反卷积也是可能的。

为什么不能对这些张量进行反卷积。我能得到一个有效滤波器大小和输出形状的例子,用于对形状为 [1,16,16,4,192]

的张量进行反卷积吗

谢谢。

  • I have a tensor of size [1,16,16,4,192]
  • I am attempting to use a filter of [1,1,1,192,192]
  • I believe that the output shape would be [1,16,16,4,192]
  • I am using "same" padding and a stride of 1.

是的,输出形状将为 [1,16,16,4,192]

下面是一个简单的例子,表明尺寸是兼容的:

import tensorflow as tf

i = tf.Variable(tf.constant(1., shape=[1, 16, 16, 4, 192]))

w = tf.Variable(tf.constant(1., shape=[1, 1, 1, 192, 192]))

o = tf.nn.conv3d_transpose(i, w, [1, 16, 16, 4, 192], strides=[1, 1, 1, 1, 1])

print(o.get_shape())

除了维度之外,您的实现中肯定还有其他问题。