tensorflow Conv2DCustomBackpropInputOp是否只支持NHWC?

lf5gs5x2  于 2023-06-24  发布在  其他
关注(0)|答案(2)|浏览(169)

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

1tuwyuhd

1tuwyuhd1#

我有这个错误,我解决了它只有改变CPU到GPU!
因此,如果您在CPU上运行您的模型,请尝试将运行时更改为CUDA,并使用您的GPU。可能会有用。

y3bcpkx1

y3bcpkx12#

输入数据的形状很可能是NCHW (Batch Size, Number of Channels, Height of the Image and Width of the Image).形式
将其形状更改为形式NHWC (Batch Size, Height of the Image, Width of the Image and Number of Channels)和with data_format='channels_last'应该可以解决您的问题。

相关问题