使用张量流解卷积/Transpose_Convolutions [英] Deconvolutions/Transpose_Convolutions with tensorflow

查看:110
本文介绍了使用张量流解卷积/Transpose_Convolutions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am attempting to use tf.nn.conv3d_transpose, however, I am getting an error indicating that my filter and output shape is not compatible.

  • 我的张量为[1,16,16,4,192]
  • 我正在尝试使用[1,1,1,192,192]过滤器
  • 我相信输出形状将为[1,16,16,4,192]
  • 我使用的是相同"填充,跨度为1.

最终,我希望输出的形状为[1,32,32,7,无关紧要"],但是我试图首先得到一个简单的案例.

Eventually, I want to have an output shape of [1,32,32,7,"does not matter"], but I am attempting to get a simple case to work first.

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

Since these tensors are compatible in a regular convolution, I believed that the opposite, a deconvolution, would also be possible.

为什么无法在这些张量上执行反卷积.我可以得到一个有效的滤波器大小和输出形状的示例,用于对形状为[1,16,16,4,192]的张量进行去卷积

谢谢.

推荐答案

  • 我的张量为[1,16,16,4,192]
  • 我正在尝试使用[1,1,1,192,192]过滤器
  • 我相信输出形状将为[1,16,16,4,192]
  • 我使用的是相同"填充,跨度为1.
  • 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]

Yes the output shape will be [1,16,16,4,192]

这是一个简单的示例,显示尺寸是兼容的:

Here is a simple example showing that the dimensions are compatible:

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())

除了尺寸之外,您的实现中还必须存在其他一些问题.

There must be some other problem in your implementation than the dimensions.

这篇关于使用张量流解卷积/Transpose_Convolutions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆