Conv2DCustomBackpropInputOp 真的只支持 NHWC 吗?

Jia*_*iao 8 computer-vision tensorflow

问题是,当我使用 TensorFlow 2.0.0 和 Python 3.7 训练用 TensorFlow 1.0.0 和 Python 2.7 编写的 gan 时,我发现 Conv2DCustomBackpropInputOp 仅支持 NHWC。是这样吗?

在此输入图像描述

小智 1

最有可能的是,您的输入数据的形状可能是以下形式:NCHW (Batch Size, Number of Channels, Height of the Image and Width of the Image).

将其形状更改为 form, NHWC (Batch Size, Height of the Image, Width of the Image and Number of Channels)and withdata_format='channels_last'应该可以解决您的问题。

  • 我认为问题是 Conv2D 是否只支持 NHWC(而不支持 NCHW)。我遇到了同样的问题,显然可以通过将顺序更改为 NHWC 来解决,但为什么我们需要这样做呢?Conv2D 接受一个参数来指定输入顺序,所以我希望它在两种情况下都能工作 (7认同)