形状必须是 4 级但是 5 级,形状:[?,32,13,13,64], [3,3,64,1]

时间:2021-06-02 19:40:43

标签: python tensorflow keras

我试图让我的模型适合它所针对的一组不同的图像。不幸的是,我收到一个错误: 我知道互联网上有很多这些,但我不确定在哪里可以指定可以解决这个问题的参数。

感谢您的帮助!

Shape must be rank 4 but is rank 5 for '{{node separable_conv2d_78/separable_conv2d/depthwise}} = DepthwiseConv2dNative[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], explicit_paddings=[], padding="SAME", strides=[1, 1, 1, 1]](Placeholder, separable_conv2d_78/separable_conv2d/ReadVariableOp)' with input shapes: [?,32,13,13,64], [3,3,64,1].

任何帮助将不胜感激!

input = Input(shape = (32, 50, 50, 3))
x = entry_flow(input)
x = middle_flow(x)
output = exit_flow(x)

model = Model (inputs=input, outputs=output)

1 个答案:

答案 0 :(得分:0)

来自评论

<块引用>

将输入从 Input(shape = (32, 50, 50, 3) 更改为 Input(shape = (32, 50, 50) 代码运行(转自 Tommy Tomsia)

相关问题